Reputation: 5255
I created a virtual environment for python3.5
using python3 -m venv --system-site-packages <venv>
.
Now when installing packages inside the virtual environment using pip3
I get the following error:
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.5/site-packages'
Why does pip want to install the packages at /usr/lib/python3.5/site-packages
and not at <venv>/lib/python3.5/site-packages
?
Upvotes: 2
Views: 4016
Reputation: 1015
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
Upvotes: 3