Thursday, September 2, 2010

More Webfaction, virtualenv --no-site-packages

I found a way to get the --no-site-packages flag for virtualenv to work "good enuf" on webfaction. The solution involved reading this forum discussion more carefully. The mojo (hack) is in post #7.

My plan is to put packages that are of general use and that rarely change in ~/lib/python2.X. These will not be available in my virtualenv. For standard packages that I want in the virtualenv, I will manually add paths to them using the virtualenvwrapper command add2virtualenv.

Update - March 1, 2013
The link above no longer works. Here is a new link, with a new and improved discussion.

By the way, if you are not sure what packages are being imported, try this:

  1. Activate your virtualenv 
  2. Start python from the command line
  3. Type import sys
  4. Type sys.path

No comments:

Post a Comment