简体   繁体   中英

Where to install virtualenv packages

Which directory is it suggested to install Python packages in a virtualenv ? For example:

$ sudo pip install requests

In which of the following directories should it be installed? Or would it be installed somewhere else?

venv/
  - bin/
  - include/
  - lib/

What is the difference between those three folders?

A few misconceptions here:

  • By using sudo pip install you're not using a virtualenv; you're installing those directly to your machine.

  • You have to create the virtualenv and then activate it via source venv/bin/activate .

  • Once it's activated, be sure that pip is installed. Then , you will be installing your packages directly to that virtualenv. Where it's ultimately going to wind up in that virtualenv is best left for pip to decide.

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