Skip to content
Advertisement

How to import a globally installed package to virtualenv folder

So I have a virtualenv folder called venv for my python project.

I can run:

venv/bin/pip install -r requirements.txt

Which installs all requirements I need for the project except one, M2Crypto. The only way to install it is through apt-get:

apt-get install python-m2crypto

How can I then add this package installed through apt to venv folder?

Advertisement

Answer

What I did after all:

cp -R /usr/lib/python2.7/dist-packages/M2Crypto /home/richard/hello-project/venv/lib/python2.7/site-packages/
cp -R /usr/lib/python2.7/dist-packages/OpenSSL /home/richard/hello-project/venv/lib/python2.7/site-packages/
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement