Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I change an an existing virtualenv to ignore global site packages? (like --no-site-package on a new one)

I can create a new virtualenv that ignores global site-packages with "--no-site-package". Is it possible to change an existing virtualenv (which was created without "--no-site-package") to also ignore the global site-packages? (So that it workes like it was created with "--no-site-package" in the first place.)

thanks in advance,

Sebastian

like image 983
Sebastian Avatar asked Oct 06 '10 14:10

Sebastian


1 Answers

I think all you have to do is create an empty file called no-global-site-packages.txt and put it into the virtualenv's python2.x folder (eg, lib/python2.6/, the one with all the modules). Then the normal site.py generated by virtualenv detects the difference and handles everything from there.

like image 135
ianmclaury Avatar answered Oct 16 '22 06:10

ianmclaury