Python virtualenv

When creating a virtual environment without site packages, do I need to install mysql and the mysqldb adapter, which is in my global site packages, in order to use them in my virtual project environment?

+4
source share
2 answers

You can also (on UNIX) create symbolic packages with symbolic links from Python site packages to your virtual package sites.

+5
source

Yes. You will need to install it exclusively for this virtualenv.

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

If you create --no-site-packages ENV with virtualenv, it does not inherit any packages from the global site package directory.

If you see files inside the site-packages directory, packages are created using symbolic links.

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 ..... 

That way, you can definitely add packages manually by creating these symbolic links for a specific package.

Adam Vandenberg answered this correctly.

0
source

All Articles