8

Running command prompt as an administrator I try to run:

easy_install -U setuptools

It returns the following:

Searching for setuptools
Reading https://pypi.python.org/simple/setuptools/
Reading http://peak.telecommunity.com/snapshots/
Reading https://pypi.python.org/pypi/setuptools
Best match: setuptools 0.8
Processing setuptools-0.8-py2.7.egg
setuptools 0.8 is already the active version in easy-install.pth
Installing easy_install-script.py script to C:\Python27\Scripts
Installing easy_install.exe script to C:\Python27\Scripts
error: C:\Python27\Scripts\easy_install.exe: Permission denied

I've spent the past few hours scouring the internet for possible solutions. I've tried messing with the UAC settings and have them set to Never Notify. Yet, I'm still getting this permission denied error.

2 Answers 2

12
+100

You can read the solution here.

Run the install.
After the error copy the easy_install .exe and .py to a temp dir (i.e. c:\temp).
Run the install again from there.

On windows, the easy_install binary is in-use during install so it can't overwrite itself. (Easy_install itself is part of the setuptools you're trying to install with itself ;)

3
  • This is not working for me. When installing from the temp folder, the process is still trying to access easy_install in the anaconda3 path. When you say "install from there", could you elaborate a bit on how you install from the temp folder? Thanks! @MarcusJohansson
    – BossaNova
    Jun 4, 2019 at 7:44
  • @BossaNova The fact easy_install.exe binary in the anaconda path is accessed isn't a problem because you started the c:\temp\easy_install.exe so the one in the path isn't in use anymore (and can be accessed and overwritten without problems). Do note that at the moment easy_install is deprecated. Doesn't pip install setuptools work for you?
    – Rik
    Jun 4, 2019 at 11:28
  • @Rik Thanks for the answer. I got the same permission error as before since, as you say, the same file is accessed. But I probably did not understand what it means to "install from there". Anyway, I could make it work somehow so for the moment it is fine.
    – BossaNova
    Jun 16, 2019 at 8:04
8

Another way would be to use the other python package manager: Pip.

easy_install pip    
pip install --upgrade setuptools

This gets around the "in-use" problem without having to move files around.

1
  • It seemed to take a combination of both for me to reinstall an old version on Windows 10 when the existing install couldn't overwrite itself and couldn't find it's own egg. C:\Python27\python -m pip install -U setuptools==3.3 -U --proxy user:pass@proxy:port
    – Seth
    Oct 19, 2018 at 14:53

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.