What file do I edit, and how? I created a virtual environment.
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
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
before the previously mentioned line, and add the following line to your
The comment by @s29 should be an answer:
One way to add a directory to the virtual environment is to install virtualenvwrapper (which is useful for many things) and then do
mkvirtualenv myenv workon myenv add2virtualenv . #for current directory add2virtualenv ~/my/path
If you want to remove these path edit the file
Documentation on virtualenvwrapper can be found at http://virtualenvwrapper.readthedocs.org/en/latest/
Specific documentation on this feature can be found at http://virtualenvwrapper.readthedocs.org/en/latest/command_ref.html?highlight=add2virtualenv