Reputation: 5972
I have a script like:
#!/usr/bin/env python
import bingsearch
bingsearch.API_KEY='Your-Api-Key-Here'
r = bingsearch.request("Python Software Foundation")
r.status_code
and also:
$which python
/usr/bin/python
But when I copy script into bingsearch
directory that I downloaded it works..
Should I set path? how?
Why do I have this error? Could you possibly help me?
Thank you
Upvotes: 0
Views: 74
Reputation: 19243
The part of the import procedure that most programmers will need to care about is usually the first—locating the file to be imported (the “find it” part). Because you may need to tell Python where to look to find files to import, you need to know how to tap into its search path in order to extend it.
The Module Search Path Order
For editing PYTHONPATH please check here
Upvotes: 1