IOError: [Errno 13] Permission denied with pip installation

2

I have asked this question on SO, but they suggested, the question is better suited for Superuser.

I installed Python 2.7.9 on Windows 7. It is supposed to have pip built-in. However, during Python installation, pip setup failed. I tried to install pip using get-pip.py, but it also failed giving the following error:

Traceback (most recent call last):
File "C:\Users\Ali\Desktop\get-pip.py", line 17853, in <module>
main()
File "C:\Users\Ali\Desktop\get-pip.py", line 145, in main
with open(pip_zip, "wb") as fp:
IOError: [Errno 13] Permission denied: 
'c:\\users\\ali\\appdata\\local\\temp\\tmpe8llat\\pip.zip'  

I searched previous answers for similar problems. They mostly refer to running cmd as administrator, which I did, but I still get the same error.
I discovered that when I try to open any file using python in write mode 'w', it fails giving me the same error. I suppose that's why pip couldn't be installed. I tried opening files in different directories, but each time it fails. This is giving me a hard time. Can somebody help me know why python can't write files on my PC?!

Ali Elbehery

Posted 2015-04-13T17:28:36.947

Reputation: 21

Answers

1

Exit all python related process and try again. pip cannot delete files which is currently using.

james.peng

Posted 2015-04-13T17:28:36.947

Reputation: 11

This is really a comment and not an answer to the original question. You can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. Please read Why do I need 50 reputation to comment? What can I do instead?

– DavidPostill – 2017-01-16T22:58:33.047

0

  1. Ensure that you are logged in with user "ali" and have write access to the folder c:\users\ali\appdata\local\temp\tmpe8llat\
  2. Uninstall existing Python 2.7.9 files
  3. Download and reinstall 2.7.9 files

gnp210

Posted 2015-04-13T17:28:36.947

Reputation: 36

Thanks for your prompt answer, but I already did all of that and still continuously getting the same error! – Ali Elbehery – 2015-04-13T21:37:56.640

When you performed the install did you do it with the Ali user account or as an Administrator? – gnp210 – 2015-04-14T21:58:46.873

Ali is an administrator account. – Ali Elbehery – 2015-04-15T01:02:53.570

-1

I found that this error does not prevent the installation to be successful.

The files pip can't delete are some temporary files I believe. I usually delete them by hand from time to time.

thomas

Posted 2015-04-13T17:28:36.947

Reputation: 99