Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

[Errno 13] Permission denied How i solve this problem #236

Closed
boomza19193 opened this issue Apr 20, 2018 · 80 comments
Closed

[Errno 13] Permission denied How i solve this problem #236

boomza19193 opened this issue Apr 20, 2018 · 80 comments

Comments

@boomza19193
Copy link

I try to install google assistant on raspberry PI 3 by this code
python -m pip install google-assistant-sdk[samples]

and then it is show

Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/lib/python2.7/dist-packages/pyasn1/error.py'
Consider using the --user option or check the permissions.

thank you.

@moham96
Copy link

moham96 commented Apr 20, 2018

You are trying to install the package to a system folder which you don't have permissions to write to.
You have three options(use only one of them):
1-setup a virtual env to install the package (recommended):

python3 -m venv env
source ./env/bin/activate 
python -m pip install google-assistant-sdk[samples]

2-Install the package to the user folder:
python -m pip install --user google-assistant-sdk[samples]

3-use sudo to install to the system folder (not recommended)
sudo python -m pip install google-assistant-sdk[samples]

@boomza19193
Copy link
Author

@moham96 Thank you so much

@moham96
Copy link

moham96 commented Apr 24, 2018

@boomza19193 You're welcome :)

@talha020
Copy link

talha020 commented May 2, 2018

@moham96 thnku also worked in my case.

@Fleker Fleker closed this as completed May 2, 2018
@schoolkid
Copy link

@moham96 Thanks a lot!

@Abhi0496
Copy link

I am using Ubuntu
I am trying to install pandas in anaconda and i was getting same error permission denied

The code i tried is:
python3 -m venv env
source ./env/bin/activate
python -m pip install pandas

I am getting this error:
File "", line 1
python3 -m venv env
^
SyntaxError: invalid syntax

@Fleker
Copy link
Contributor

Fleker commented May 31, 2018

Which version of Python are you using?

@Abhi0496
Copy link

Python 3.6.3

I don't know why it was showing the error then, but I tried once again now and used only-
python3 -m pip install pandas

And it worked,
Thank you

@animanoir
Copy link

commenting to save the probable solution

@horaanchal
Copy link

While installing tensorflow with native pip in ubuntu 16.04 it shows me an error:

Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/gast'
Consider using the --user option or check the permissions.

Anyone can help me solve this problem!
Thanks

@wichayut
Copy link

wichayut commented Jul 2, 2018

try this:

pip install --user tensorflow

@zramya
Copy link

zramya commented Jul 3, 2018

I am using python 2.7 version

I tried using python2 -m install pandas. But I am getting error telling "command is not recognized as internal or external command"

please help me on this

@MikeBirdsall
Copy link

use
python2 -m pip install pandas
you left out pip

@aalfaroiii
Copy link

Thank you moham96 It also helped to solve my problem.

@adampei
Copy link

adampei commented Jul 27, 2018

perfect you save my day

@al4xs
Copy link

al4xs commented Aug 5, 2018

Obrigado Mohamed, só você resolveu meu problema!

Mas agora o meu terminal está assim:

(env) klann@klann-PC:~/Documents$

como retirar esse "env" ?

@omarjnb
Copy link

omarjnb commented Aug 6, 2018

Im trying to execute the DirichletForest topic modeling code in bash/Linux which has been published on GitHub http://pages.cs.wisc.edu/~andrzeje/research/df_lda.html

While I'm executing the code in py2.7 Linux, I get this error :

omar@DESKTOP-0CAAKGI:/mnt/c/Users/omar3/Desktop/sentiment-analysis/coding/arXivLDA/code/LDAlike/DF-LDA-0.1.1$ python setup.py install
running install
running build
running build_py
running build_ext
running install_lib
copying build/lib.linux-x86_64-2.7/ConstraintCompiler.py -> /usr/local/lib/python2.7/dist-packages
error: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/ConstraintCompiler.py'
omar@DESKTOP-0CAAKGI:/mnt/c/Users/omar3/Desktop/sentiment-analysis/coding/arXivLDA/code/LDAlike/DF-LDA-0.1.1$

Any help!!
Thanks

@WV-no7
Copy link

WV-no7 commented Aug 11, 2018

That error is usually because of user permission stuff.Just use "pip install --user numpy". That should work. In case it doesn't then Try using "sudo" before the command. @omarjnb

@Rama-Adim
Copy link

On Windows server. Open the command prompt by "Run as Administrator" and try again.

@sts77
Copy link

sts77 commented Sep 18, 2018

I am trying to install face_recognition in jupyter terminal in Anaconda Navigator, using python 2.7
I used the command:
pip install face_recognition
Then it is showing that :

Requirement already satisfied: face_recognition in ./anaconda2/lib/python2.7/site-packages

But when I run :
import face_recognition
it is showing that :

ImportError: No module named face_recognition

Then I checked the Face Recognition Installation Documentation:

From there I got the command pip2 install face_recognition
when i tried that I got the error:

sts:~$ pip2 install face_recognition
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/init.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
warnings.warn(warning, RequestsDependencyWarning)
Collecting face_recognition
Using cached https://files.pythonhosted.org/packages/3f/ed/ad9a28042f373d4633fc8b49109b623597d6f193d3bbbef7780a5ee8eef2/face_recognition-1.2.3-py2.py3-none-any.whl
Requirement already satisfied: Pillow in /usr/lib/python2.7/dist-packages (from face_recognition) (3.1.2)
Collecting dlib>=19.7 (from face_recognition)
Requirement already satisfied: numpy in /usr/local/lib/python2.7/dist-packages (from face_recognition) (1.14.5)
Collecting face-recognition-models>=0.3.0 (from face_recognition)Collecting Click>=6.0 (from face_recognition)
Using cached https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl
Installing collected packages: dlib, face-recognition-models, Click, face-recognition
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/dlib.so'
Consider using the --user option or check the permissions.

How to overcome this error?

@ampaire
Copy link

ampaire commented Sep 21, 2018

Thanks it works

@PatelTixa15
Copy link

Could not install packages due to an EnvironmentError: [Errno 28] No space left on device: '/home/priyanka/.local/lib'

answer this error?

@Fleker
Copy link
Contributor

Fleker commented Oct 8, 2018

@PatelTixa15 you need to look at your storage size. There seems to be too many files, and there's no room left for what you're trying to install.

@PatelTixa15
Copy link

okay
but how to transfer all data from one disk to another in ubuntu. like from home directory to any other directory .bcaz all data save by default in home directory.

@Fleker
Copy link
Contributor

Fleker commented Oct 8, 2018

There's probably some files on your system that you can move over, like in your home directory. You can use a terminal or a file explorer app. If you have further questions, please make a new issue.

@Ishaan28malik
Copy link

Thanks alot it worked for me as well @boomza19193

@notcooler
Copy link

Thank You So Much

@aleej123
Copy link

Hello everyone need some help I have installed python 3.5 and want to install h5py package and I am getting an error :(

Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/h5py'
Consider using the --user option or check the permissions.

@MUsman27665
Copy link

3rd option worked for me thanks your not recommended one...

@thinksanky
Copy link

Thanks! it worked

@emlanis
Copy link

emlanis commented Jan 18, 2020

just put --user after "install"
so:
pip install --user whatEverYouWant

it works.. successfully.. thanks

@smanohar76
Copy link

I am running python3.7 on a CENTOS VM. In order to install request library the below command worked for me
python3.7 -m pip install --user requests

@smanohar76
Copy link

just put --user after "install"
so:
pip install --user whatEverYouWant

it works.. successfully.. thanks

That worked

@sameerapriya
Copy link

> source ./env/bin/activate
./env/bin/activate (line 74): Missing end to balance this if statement
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
^
from sourcing file ./env/bin/activate
	called on standard input

source: Error while reading file “./env/bin/activate”

Doesn't work for fish shell.

try using activate.fish at the end

@anubhvshrma18
Copy link

i am also getting the same error with python 3.8
usr/bin/env - Permission denied
any solution?

@sameerapriya
Copy link

i am also getting the same error with python 3.8
usr/bin/env - Permission denied
any solution?

Could be a path error as well
check your path and the packages installed

@areebsyed
Copy link

You are trying to install the package to a system folder which you don't have permissions to write to.
You have three options(use only one of them):
1-setup a virtual env to install the package (recommended):

python3 -m venv env
source ./env/bin/activate 
python -m pip install google-assistant-sdk[samples]

2-Install the package to the user folder:
python -m pip install --user google-assistant-sdk[samples]

3-use sudo to install to the system folder (not recommended)
sudo python -m pip install google-assistant-sdk[samples]

Why is sudo option not recommended?

@talk2ajay
Copy link

moham96 - thank you savior

@tklander95
Copy link

Hi i need some help here. Doing machine learning but I am facing OSError.

OSError: Unable to create file (unable to open file: name = 'cnnh5', errno = 13, error message = 'Permission denied', flags = 13, o_flags = 302)

@NageshRu
Copy link

NageshRu commented Mar 13, 2020

Go to the super user/root then install packages.
sudo su
pip3 install .....

@Tejas2909
Copy link

i have a doubt that when i convert my .py to .exe file in virtual environment then where should we place our pytho file inside the virtual environment

@BuddyBob
Copy link

BuddyBob commented Aug 2, 2020

Who's a legend... you are!

@MareksNo
Copy link

You are trying to install the package to a system folder which you don't have permissions to write to.
You have three options(use only one of them):
1-setup a virtual env to install the package (recommended):

python3 -m venv env
source ./env/bin/activate 
python -m pip install google-assistant-sdk[samples]

2-Install the package to the user folder:
python -m pip install --user google-assistant-sdk[samples]

3-use sudo to install to the system folder (not recommended)
sudo python -m pip install google-assistant-sdk[samples]

I know it has been 2 years, but is it possible for me to use the first option if I already have the venv activated?

@ShahbazU
Copy link

Hi i need some help here.Installing librosa package and getting this error.
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: 'C:\Python38\Lib\site-packages\pycache\soundfile.cpython-38.pyc'

@bitman333
Copy link

You are trying to install the package to a system folder which you don't have permissions to write to.
You have three options(use only one of them):
1-setup a virtual env to install the package (recommended):

python3 -m venv env
source ./env/bin/activate 
python -m pip install google-assistant-sdk[samples]

2-Install the package to the user folder:
python -m pip install --user google-assistant-sdk[samples]

3-use sudo to install to the system folder (not recommended)
sudo python -m pip install google-assistant-sdk[samples]

Number 1 worked for me. Thanks.

@sobabear
Copy link

sobabear commented Apr 9, 2021

thank you it works a lot

@sunith-kumar
Copy link

ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.

@Soorya-111
Copy link

I am running python3.7 on a CENTOS VM. In order to install request library the below command worked for me python3.7 -m pip install --user requests

it worked for me

@zeeshan52123
Copy link

Error: [Errno 13] Permission denied: 'C:\UMS-API\myenv\Scripts\python.exe' generate this error how to resolve

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests