I am running ubuntu, and I don't have a .bash_profile.
So my question is, where exactly is my python path set then?
How can I see what the current python path is, doing:
$PYTHON_PATH
doesn't return anything?
Setting Path in Unix or Linux In the csh shell, type the following sentence: PATH “$PATH:/usr/local/bin/python” and press Enter. If you are using the standard flavour of Linux, open up the bash shell and type the following phrase, export PATH=”$PATH:/usr/local/bin/python” and press Enter.
PYTHONPATH is an environment variable which you can set to add additional directories where python will look for modules and packages. For most installations, you should not set these variables since they are not needed for Python to run. Python knows where to find its standard library.
It's set by the site
module, and the interpreter executable itself. sys.path
contains the current value.
You can see your python path in python like so:
>> import sys
>> print sys.path
you can create a .bash_profile with your favorite editor, and put into it:
export PYTHONPATH=$HOME/lib/python
or whatever, that's one example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With