IOError: [Errno 13] Permission denied with pip installation

6,581

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

Share:
6,581

Related videos on Youtube

Ali Elbehery
Author by

Ali Elbehery

Updated on September 18, 2022

Comments

  • Ali Elbehery
    Ali Elbehery over 1 year

    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
    Ali Elbehery about 9 years
    Thanks for your prompt answer, but I already did all of that and still continuously getting the same error!
  • gnp210
    gnp210 about 9 years
    When you performed the install did you do it with the Ali user account or as an Administrator?
  • Ali Elbehery
    Ali Elbehery about 9 years
    Ali is an administrator account.
  • DavidPostill
    DavidPostill over 7 years
    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?