"PermissionError: [Errno 13]" when trying to update setuptools
Answered
I'm on PyCharm Professional 2016.3.2 and Python 3.6.0. I'm trying to update my setuptools from 33.1.1 to 34.1.0 using Settings > Project Interpreter. It fails and I receive the following error:


How to fix?
Please sign in to leave a comment.
Hi there,
Does it work if you try to execute this command from the terminal? Can you install other packages from PyCharm, or it happens only with setuptools?
Overall, it looks like an expected restriction if you installed Python system-wide "for all users" and don't run PyCharm with elevated permissions.
@Mikhail, PyCharm was installed through Toolbox app, it's local inside my %AppData%. Python on the other hand is system-wide, inside my %Program_Files%\Python36.
This update issue happens with pip and setuptools. I can only update them via root terminal.
UPDATE #01: I reinstalled Python 3.6.0, this time using local-install, which defaults the installation path to %AppData%\Local\Programs\Python. Now I can update pip and setuptools inside PyCharm.
UPDATE #02: So, it seems it's not working for virtualenvs. Just tried updating setuptools inside a virtualenv and got the following error (tried restarting, didn't fix):
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'd:\\documents\\pycharm\\.venv\\3.6.0\\<my_project>\\lib\\site-packages\\setuptools-18.1-py3.6.egg' -> 'C:\\Users\\<user>\\AppData\\Local\\Temp\\pip-679t_bcl-uninstall\\documents\\pycharm\\.venv\\3.6.0\\<my_project>\\lib\\site-packages\\setuptools-18.1-py3.6.egg'
UPDATE #03: I had to leave the computer for some time and when I got back I gave it another go, this time it worked (I don't know why), but it still gave me an error:
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'D:\\Documents\\PyCharm\\.venv\\3.6.0\\<my_project>\\lib\\site-packages\\setuptools-18.1-py3.6.egg'
At least setuptools is up-to-date now!
Sorry for the late reply.
Yes, it seems to be a known problem that we don't show any dialog that allows you to temporarily elevate process rights in order to update packages in system directories. Please follow PY-18154 that describes a similar issue. For the time being you indeed have to run PyCharm with higher privileges or use administrator's terminal whenever you want to change packages installed in the system interpreter.
UPDATE I've missed those updates somehow.
I'm not quite sure about this particular problems with .egg file, it might a problem specific to old versions of setuptools on Windows (we're going to update versions of bundled packaging tools in PyCharm 2017.1). Which versions of pip and setuptools do you use now in that project?
https://www.youtube.com/watch?v=gWfVwnOyG78
go through this link... this is for tensorflow package installation but my setuptools problem got solved....you can use this method to install different packages.
Solution (from Stackoverflow, where else?): https://stackoverflow.com/questions/49338652/pip-install-u-setuptools-fail-windows-10