Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip install -U setuptools fail windows 10

I just installed Python3.7 and Pycharm on my Windows 10 PC. I am running pip version 9.0.2

In Pycharm, it says I have version 28.8.0 of setuptools, when I try to upgrade this in Pycharm, which I believe runs the line

pip install -U setuptools

I get the error:

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'c:\users\Username\pycharmprojects\untitled1\venv\lib\site- packages\setuptools-28.8.0-py3.6.egg' -> 'C:\Users\Username\AppData\Local\Temp\pip-i5jxitem- uninstall\users\Username\pycharmprojects\untitled1\venv\lib\site- packages\setuptools-28.8.0-py3.6.egg'

I have tried running

pip install --upgrade setuptools

which runs successfully and says I have the latest version.

Does anyone know how I can successfully update setuptools?

The reason I'd like setuptools to be up to date, is so I can then get rid of the egg_info error installing other packages.

like image 839
MMarshall Avatar asked Mar 17 '18 15:03

MMarshall


People also ask

Does pip install Setuptools?

Type “ pip install setuptools ” (without quotes) in the command line and hit Enter again. This installs setuptools for your default Python installation. The previous command may not work if you have both Python versions 2 and 3 on your computer.

How do I install Setuptools on Windows?

The recommended way to install setuptools on Windows is to download ez_setup.py and run it. The script will download the appropriate . egg file and install it for you. Once installation is complete, you will find an easy_install program in your Python Scripts subdirectory.


2 Answers

I have the same error. Not sure why it happened. But I managed to upgrade by running: pip install setuptools --upgrade --ignore-installed

like image 114
Jonny Waffles Avatar answered Oct 17 '22 20:10

Jonny Waffles


You can also try:

easy_install --upgrade setuptools 

Even though easy_install's deprecated, there's a good chance it'll still work on Windows.

If you try to use pip to upgrade setuptools:

pip install -U setuptools

it seems to get stuck on an error about 10.0 vs 18.0 "You should consider upgrading via the 'python -m pip install --upgrade pip' command."

The official pip doco(https://pip.pypa.io/en/stable/installing/#upgrading-pip) says on Windows to use this:

python -m pip install --upgrade pip

However, it seemed pip and setuptools had a hiccup with a circular dependency or lock around pip-v9.0 or 10.0 to pip-18.0 and setuptools v28.0 to v39.0 or 40.0 so persevere with this:

python -m pip install --force-reinstall pip

You need setuptools >= 39.0 if you want to install pipenv also.

like image 4
Gavin Avatar answered Oct 17 '22 19:10

Gavin