4

When creating a virtual environment with no -site packages do I need to install mysql & the mysqldb adapter which is in my global site packages in order to use them in my virtual project environment?

2 Answers 2

5

You can also (on UNIX) symlink specific packages from the Python site-packages into your virtualenv's site-packages.

Sign up to request clarification or add additional context in comments.

1 Comment

+1, I was trying to capture the symlinks from my virtual env so that I could put it here. When, I came back you had already answered it.
0

Yes. you will need to install then exclusively for this virtualenv.

See: http://virtualenv.openplans.org/#the-no-site-packages-option

If you build with virtualenv --no-site-packages ENV it will not inherit any packages from global site package directory.

If you see the files inside the site-packages directory, the packages are made via symlinks.

drwxr-xr-x   3 ashish  staff    102 Nov 24 20:52 ..
lrwxr-xr-x   1 ashish  staff     85 Nov 24 20:52 UserDict.py -> /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/UserDict.py
.....

So you could definitely add packages manually by creating these symlinks for specific package.

Adam Vandenberg correctly answers that.

3 Comments

Hey thank you for your help & answer. I can also use pip & or easy_install to install the packages I want also correct?
@demet8: Thanks a lot. I was a bit late in providing the complete answer. Please accept Adam Vandenberg's answer as he beat me to it.
@Adam Vandenberg: @demet8: Thanks for making the change. It was important.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.