pip install access denied on Windows

2020-01-23 10:25发布

I am trying to run pip install mitmproxy on Windows, but I keep getting access denied, even with cmd and PowerShell using the Run as Administrator option.

WindowsError: [Error 5] Access is denied: 'c:\\users\\bruno\\appdata\\local\\temp\\easy_install-0fme6u\\cryptography-0.9.1\\.eggs\\cffi-1.1.2-py2.7-win-amd64.egg\\_cffi_backend.pyd'

How can I make this work?

15条回答
趁早两清
2楼-- · 2020-01-23 11:23

Just close all the python files opened. And try to run as administrator. It will work.

e.g.

pip install numpy
查看更多
SAY GOODBYE
3楼-- · 2020-01-23 11:24

Change your Python installation folder's security permissions by:

  1. Open a Python shell
  2. Go to task manager
  3. Find the python process
  4. Right-click and open location
  5. The folder will open in explorer, go up a directory
  6. Right-click the folder and select properties
  7. Click the security tab and hit 'edit'
  8. Add everyone and give them permission to Read and Write.
  9. Save your changes

If you open cmd as admin; then you can do the following:

If Python is set in your PATH, then:

python -m pip install mitmproxy
查看更多
霸刀☆藐视天下
4楼-- · 2020-01-23 11:25

Opening command prompt As Administrator just worked for me without using Python executable. Right click on command prompt shortcut and choose "Run as Administrator". Then run the following command.

pip install Django
查看更多
登录 后发表回答