Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is my virtual environment (python) causing my PYTHONPATH to break?

In my /etc/profile, I set PYTHONPATH as something.

But when I source myvirtual-env

And then do this in python:

>>> import sys
>>> print sys.path

I don't see my paths anywhere.

like image 472
TIMEX Avatar asked Jan 13 '11 23:01

TIMEX


1 Answers

That's the point of the virtualenv. It doesn't inherit from the rest of your setup. If you want a PYTHONPATH, you need to explicitly set one.

This djangousers post is probably helpful, you want to use virtualenvwrapper to solve this problem.

More info in this other SO post on a similar problem.

like image 183
Paul McMillan Avatar answered Sep 28 '22 04:09

Paul McMillan