I know that virtualenv, if you did not pass the --no-site-packages argument when creating a new virtual environment, will associate packages in /usr/local/lib/python2.7/site-packages (for Python 2.7) with the newly created virtual environment . On Ubuntu 12.04 LTS, I have three locations where Python 2.7 packages can be installed (using the default Ubuntu Python 2.7):
/usr/lib/python2.7/dist-packages : I have my global installation of ipython, scipy, numpy, matplotlib packages, which are harder and harder for me to install separately (and all their dependencies) if they are not available through the scipy stack ./usr/local/lib/python2.7/site-packages : this is empty and I think it will remain the same on Ubuntu if I do not install the package from the source code./usr/local/lib/python2.7/dist-packages : it has very important local packages for astronomy, especially those related to PyRAF, STScI, etc., and they are extremely complex and time-consuming to install separately.
Please note that a global directory such as /usr/lib/python2.7/site-packages does not exist on my system. Also note that my global installation is ipython, scipy, etc. Allows me to use these packages on the fly without having to start / activate the virtual environment every time.
Naturally, now I want to use virtualenv to create one virtual environment in the user's home directory, which I will use for future projects. However, I would like this virtual environment to be created to link / copy all my packages in places (1) and (3) in the list above. The main reason for this is because I donβt want to go through the pip install process (if at all possible) to reinstall ipython, scipy, astro packages, etc. For this (and possibly another) virtual environment.
Here are my questions:
- Is there any way to tell virtualenv that I would like it to bundle / copy packages in these two
dist-packages directories for virtual environments that will be created in the future? - When I end up updating my global installation of scipy, ipython, etc. in the two
dist-packages directories, will this also update / change the packages used by my virtual environment (and which they originally received when creating the virtual virtual disk)? - If I ever installed a package from a source in Ubuntu, will it go to
/usr/local/lib/python2.7/dist-packages or /usr/local/lib/python2.7/site-packages ?
Thanks in advance for your help!
python ubuntu environment virtualenv packages
quantumflash Oct 06 '13 at 16:12 2013-10-06 16:12
source share