I'd usually prefer to create virtualenvs with --no-site-packages option for more isolation, and also because default python global packages includes quite a lot of packages, and usually most of them are not needed. However I'd still want to keep a few select packages in global, like PIL or psycopg2. Is there a good way to include them into the virtualenv, that can also be automated easily?
views:
62answers:
2
A:
I haven't actually tried this with those specific packages, but I would guess that a simple symlink from the global site-packages into the virtualenv's site-packages might work, and this is easily scriptable.
Carl Meyer
2010-05-07 07:05:34
+1
A:
If you're using virtualenvwrapper and you might be able to use the postmkvirtualenv script to automatically create symlinks in the new virtualenv sitepackages directory.
#!/bin/sh
cdsitepackages
ln -s /path/to/system/site-packages/package-name
cdvirtualenv
moberley
2010-08-03 19:08:13
Forgot about this question, but I ended up doing exactly this.
Béres Botond
2010-08-04 09:47:26