Cerin
Cerin

Reputation: 64739

Modify Python virtualenv to not reference global Python installation

How do you modify a Python virtual environment so that it doesn't reference the global Python site-packages?

I created a virtualenv, and installed dozens of packages, some that are C-extensions and took a while to build, but I accidentally forgot to include the --no-site-packages flag, causing it to be linked it to the global site-packages. I don't want to just delete it and re-install all over again. Is there an easy way to de-link it from the global site-packages?

Upvotes: 4

Views: 168

Answers (1)

mrlouhibi
mrlouhibi

Reputation: 121

You can use virtualenvwrapper and :

env1)$ toggleglobalsitepackages
  Disabled global site-packages

OR : Create an empty file called no-global-site-packages.txt and put it into the virtualenv's folder lib/python2.7/

Upvotes: 2

Related Questions