sten
sten

Reputation: 7486

VENV : Accessing system packages?

I want to be able to access a module installed system-wide after the venv was created. You can see that I can access bcrypt when outside VENV w/o problem, but not inside it (btw. installation of bcrypt inside VENV fails)

# apt-get install python-bcrypt

$ python -c 'import bcrypt'

$ . venv/bin/activate

(venv) $ virtualenv env --system-site-packages
New python executable in env/bin/python
Installing setuptools, pip...done.

(venv) $ python -c 'import bcrypt'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named bcrypt

Upvotes: 1

Views: 3988

Answers (1)

sten
sten

Reputation: 7486

the correct cmd is (venv vs env) :

(venv)$ virtualenv venv --system-site-packages

Upvotes: 2

Related Questions