Pip Install Failing With: Oserror: [Errno 13] Permission Denied on Directory

pip install failing with: OSError: [Errno 13] Permission denied on directory

Option a) Create a virtualenv, activate it and install:

virtualenv .venv
source .venv/bin/activate
pip install -r requirements.txt

Option b) Install in your homedir:

pip install --user -r requirements.txt

My recommendation use safe (a) option, so that requirements of this project do not interfere with other projects requirements.

Could not install packages due to an EnvironmentError: [Errno 13]

If you want to use python3+ to install the packages you need to use pip3 install package_name

And to solve the errno 13 you have to add --user at the end

pip3 install package_name --user

EDIT:

For any project in python it's highly recommended to work on a Virtual enviroment, is a tool that helps to keep dependencies required by different projects separate by creating isolated python virtual environments for them.

In order to create one with python3+ you have to use the following command:

virtualenv enviroment_name -p python3

And then you work on it just by activating it:

source enviroment_name/bin/activate

Once the virtual environment is activated, the name of your virtual environment will appear on left side of terminal. This will let you know that the virtual environment is currently active.
Now you can install dependencies related to the project in this virtual environment by just using pip.

pip install package_name

pip install planemo fails with error: ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/usr/local/locale'

. .venv/bin/activate

This line activates your virtual environment. "activating" in this case means setting a bunch of environment variables, including PATH.

/usr/local/bin/pip3 install planemo

And then you completely ignore PATH by calling pip3 with an absolute path. Make that

pip install planemo

and it should work.

pip install - PermissionError: [Errno 13] Permission denied

Have you installed its dependencies like numpy and scipy? Check it out and then we will proceed further.

Final Solution:
try conda like conda install scikit-learn=_version_

Permission Denied When Installing Packages Using Pip In Docker Container Django

In my case, I've installed the package using the root user by adding -u 0 which tells docker to go in as root user.

docker exec -u 0 -it mycontainer bash


Related Topics



Leave a reply



Submit