I am using a MacPorts installation of Python2.7. I have used pip to install a number of packages in my home directory (pip install --user). The issue is that when I use virtualenv, none of those packages make it to the new virtual environment. I know it's probably because virtualenv doesn't look at the packages installed in my home dir when making the new environment.

I have been searching for a virtualenv option to make it see those packages as well, but no luck. Am I missing something or will I need to install the packages globally after all to make virtualenv see them?

Example:

pip freeze

> Django==1.3.1
> MySQL-python==1.2.3
> PIL==1.1.7
> virtualenv==1.6.4
> wsgiref==0.1.2

source workingEnv/bin/activate
pip freeze

> wsgiref==0.1.2
link|improve this question
Which directory are you in and which pip is used? – Mark Sep 10 '11 at 12:16
I'm in ~/Desktop and the pip is the file that is installed with the MacPorts easy_install. – Jibran Sep 10 '11 at 13:06
How do you make the virtual environment - as some parameters will not copy anything from site-packages. - Also for MySQL I find it easier to use macports to install that rather than easy_install – Mark Sep 10 '11 at 13:16
virtualenv workingEnv however, those packages are installed in my home dir [~/Library/Python/2.7/lib/python/site-packages], not in my main site-packages. – Jibran Sep 10 '11 at 13:41
feedback

1 Answer

virtualenv only copies from the global site-packages and not your local ones so I would either use macports to install all these needed packages or install them into the global install. An alternative is to create a bootstrap script that can add to PYTHONPATH to pick up these python packes in you home directory.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.