2

我创建了一个虚拟环境来python3.5使用python3 -m venv --system-site-packages <venv>.

现在,在使用虚拟环境中安装软件包时pip3,出现以下错误:

PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.5/site-packages'

为什么 pip 想要将软件包安装在 at/usr/lib/python3.5/site-packages而不是 at <venv>/lib/python3.5/site-packages

4

1 回答 1

3

If you want pip to install the packages at <venv>/lib/python3.5/site-packages, please create the virtual environment by this way: python3 -m venv <venv>

By the way, I usually create virtual environment as follows: alias venv='virtualenv --python=python3 venv' alias actvenv='source venv/bin/activate' venv actvenv

于 2017-05-24T13:44:42.350 回答