简体   繁体   中英

how to install python packages in “site-packages”?

I made Virt2 virtual environment.
using $ python -m venv Virt2 .

I want to install my custom packages in " site-packages " directory. However packages are installed in " dist-packages " directory.

在此处输入图片说明

what should I do to install packages in my python virtual environment site-packages ??


my python version 3.6.2 (in /usr/local/bin)

You use sudo and sudo switches user to root , ie you're completely outside of you virtual env. System pip3 outside of virtual env installs packages into a system directory which is dist-packages .

Run pip install inside you virtual env without sudo.

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