Can't install python modules on virtualenv usi

2019-08-06 12:27发布

问题:

I am trying to install python modules from a requirements.txt file on a virtualenv. Pip runs, and installs them. But I can't import the modules installed, nor do they show up when I run pip freeze.

This is how I run pip

(test)elssar@elssar-laptop:~$ sudo pip install -r /path/to/requirements.txt

I have even tried to run that command from the directory containing requirements.txt but nothing seems to work.

Am I missing something?

回答1:

Try running pip without sudo; it might set a different environment which overwrites the virtualenv settings.