简体   繁体   中英

pip has to reinstall all packages in exported virtualenv

I have a question about python virtualenv. I get a virtualenv for a project with all packages required to run that project. But when i run it for the first time and it crash 'cause python has some requirements not satisfied. So i check if there is all packages inside:

virtualenv/lib/python2.7/site-packages/

and all packages required are inside.

But when i type:

pip list

packages doesn't shown. So i have to run:

pip install -r requirements.txt

pip downloads them again. So my question is, why pip downloads and reinstall them again if they are installed yet ? And how i can force pip to reinstall all packages inside virtualenv ?

The problem was that all scripts inside the virtualenv were created on another pc with them paths. Indeed when i launched python or pip from virtualenv they ran from my global path 'cause couldn't find virtualenv script path and in particular pip shown my global packages. Fixing directives path of all script inside virtualenb/bin/ to my real virtualenv path solved this issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM