Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't configure a virtualenv TO NOT use packages outside my virtual environment on Windows

I have python 2.7 installed globally in c:/python27 on Windows 7.

I successfully installed virtualenv 1.11.6 using pip install virtualenv

I then create a virtual env using python.exe -m virtualenv c:/virtualenv/env1 and activate it:

cd c:/virtualenv/env1/scripts

activate

The prompt change showing we that everything worked properly:

(env1) c:\virtualenv\env1\Scripts>

Now my problem is that my just created virtual env is still inheriting packages from the global python27 and I don't want that.

I try creating a new virtual env using --no-site-packages but same problem. In the virtualenv documentation it is said that the --system-site-packages may be use to volontarily inherit packages from global python and that means that default behavior should be to not have that inheritance...

Any idea what is wrong with my setup?

like image 802
Etienne Desgagné Avatar asked Sep 29 '22 20:09

Etienne Desgagné


1 Answers

After the comment thread... solution is don't put your site-packages in your PYTHONPATH. :)

like image 88
Silas Ray Avatar answered Oct 30 '22 11:10

Silas Ray