What file do I edit, and how? I created a virtual environment.
EDIT #2
The right answer is @arogachev's one.
If you want to change the PYTHONPATH
used in a virtualenv, you can add the following line to your virtualenv's bin/activate
file:
export PYTHONPATH="/the/path/you/want"
This way, the new PYTHONPATH
will be set each time you use this virtualenv.
EDIT: (to answer @RamRachum's comment)
To have it restored to its original value on deactivate
, you could add
export OLD_PYTHONPATH="$PYTHONPATH"
before the previously mentioned line, and add the following line to your bin/postdeactivate
script.
export PYTHONPATH="$OLD_PYTHONPATH"