Asdfg
Asdfg

Reputation: 12203

pip install from global packages to virtual env

We have developer machine with 100s of python packages installed on it. There is no internet connectivity from this box.

While installing packages into my existing virtualenv using pip, is there a way I can specify to install that package from global set of packages?

pip version: 7.0.3 

Upvotes: 0

Views: 899

Answers (1)

Michael Mior
Michael Mior

Reputation: 28753

I don't believe you can install packages like this using pip, but you should be able to just copy the folders from the global installation to the virtualenv environment. For everything below, replace 2.7 with whatever Python version you're using.

Packages installed globally will typically be located in /usr/local/lib/python2.7/dist-packages. A package will typically have two folders. One named after the package name and another containing the version and ending with .dist-info or .egg-info depending on how the package was installed.

Assuming venv/ is a folder containing your virtualenv, if you copy both of the folders into venv/lib/python2.7/site-packages then they should be available in your virtualenv.

Upvotes: 2

Related Questions