37

How to set path for python 3.7.0? I tried the every possible way but it still shows the error!

Could not install packages due to an EnvironmentError: [WinError 5]

Access is denied: 'c:\program files (x86)\python37-32\lib\site-packages\pip-10.0.1.dist-info\entry_points.txt'

Consider using the --user option or check the permissions

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Shwetali Rane
  • 371
  • 1
  • 3
  • 3
  • Does this answer your question? [pip install access denied on Windows](https://stackoverflow.com/questions/31172719/pip-install-access-denied-on-windows) – Gonçalo Peres Jan 10 '22 at 11:57

9 Answers9

27

Add --user to the command.

eg:

pip install -r requirements.txt --user
Neuron
  • 5,141
  • 5
  • 38
  • 59
Surendiran S
  • 411
  • 4
  • 4
15

Append the --user modifier to your command as suggested in the error.

--user makes pip install packages in your home directory instead, which doesn't require any special privileges.

More: What is the purpose "pip install --user ..."?

isherwood
  • 58,414
  • 16
  • 114
  • 157
13

Run your command Prompt on Admin-Mode in Windows,it will stop throwing errors for user-rights.

Steps:

  1. On Windows, type "Cmd" on searchbox to search for command prompt.

  2. When "Command Prompt" search result appears,right-click>Run as Administrator.

isherwood
  • 58,414
  • 16
  • 114
  • 157
lionxlamb
  • 391
  • 5
  • 14
  • This also fixed the issue I had for installing a python lib from a setup.py script. `python setup.py install` had to be run via command prompt on the admin mode.. – alextc Oct 03 '19 at 05:40
11

You can add --user in the end of your command. This works well in my case!

--user

My example:

python -m pip install --upgrade pip --user
  • how does this provide anything not already covered in other answers, such as https://stackoverflow.com/a/51543327/4298200 ? – Neuron Feb 11 '22 at 13:14
2

Just try on Administrator cmd

pip install --user numpy
Alkesh Mahajan
  • 469
  • 6
  • 17
1

Run your command prompt on admin mode. type :

cd\

then type:

cd [Your python location path]

on mycomputer it's: cd C:\Users\hp\AppData\Local\Programs\Python\Python37-32 then type:

python -m pip install --upgrade pip

You can follow this guide~ https://datatofish.com/upgrade-pip/

Sang9xpro
  • 435
  • 5
  • 8
0

I had the same problem.

After installing Python for all the users, wanted to install Django.

For that I've gone to the Command Prompt (without using Admin mode) and

pip.exe install django==2.2

This prompted the following message

Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\program files\python37\lib\site-packages\pip-19.0.3.dist-info\entry_points.txt' Consider using the --user option or check the permissions.

The way I've used to solve it was to add --user in the end of the command, just like the prompt message suggests («Consider using the --user»).

pip.exe install django==2.2 --user

Then everything worked fine.

molecoder
  • 423
  • 1
  • 7
  • 24
0

The question was for windows but if any linux users that stumbled here (like me) : Permission Error Persists by adding --user in my virtualenv on Ubuntu 19 when I want to generate requirements.txt. Also, I can't pip install --user as well since I'm in an virtualenv. My solution was just using sudo pip3 install pipreqs to install another pipreqs for super user.

Willy satrio nugroho
  • 908
  • 1
  • 16
  • 27
-1

I wanted to throw an answer out here because I've been against a rock wall since upgrading to python 3.18. Pip install stopped working with a module error which was rectified with py -m pip install --user. but I would still get this permissions error. I uninstalled, reinstalled, and downgraded Python and Pip. I ran command prompt as administrator. None of it worked.

The only thing that worked was to pip download and then pip install the package from my c:/ drive. Totally BS workaround, but if you'r as stuck as I was it works.

mr_yager
  • 54
  • 6