0

I updated pip yesterday, and since then I can not install anything using pip. I get the error:

ERROR: No .egg-info directory found in C:\Users\(my username)\AppData\Local\Temp\pip-pip-egg-info-7kf6p_vq

I have tried uninstall python, and reinstalling it, and downgrading pip to the version that i thought I had last.

Running python 3.9. I looked at other stackoverflow posts, but non have worked for me so far

Nima Hojat
  • 15
  • 6
  • Did you also uninstall and reinstall pip? Please also try to delete your entire temp folder – tturbo Oct 21 '22 at 08:21
  • Related: https://github.com/actions/setup-python/issues/165 – FObersteiner Oct 21 '22 at 08:23
  • tturbo, I uninstalled pip but couldnt figure out how to install it again. So I ended up uninstall python and reinstalling it (with pip) – Nima Hojat Oct 21 '22 at 08:33
  • FObersteiner, thank you for the link. I tried the steps they detailed but no luck. – Nima Hojat Oct 21 '22 at 08:44
  • So it does not matter which package you try to install, you always get .egg-info dir not found error? Do you install Python as user or system-wide (with administrative rights)? – FObersteiner Oct 21 '22 at 08:53
  • I have tried a few packages, and all give the same error. I have tried downloading python just for my user, and also downloading it using my companies software portal. – Nima Hojat Oct 21 '22 at 08:58
  • so you have one Python version installed, for the user only. No "remains" from other Python installations on disk? No conda/anaconda etc. installed? Did you try to [re-install pip](https://pip.pypa.io/en/stable/installation/#get-pip-py) via `get-pip.py`? – FObersteiner Oct 21 '22 at 09:30
  • I dont have other versions of python installed. I uninstall anaconda 2 days ago (after updating spyder, my anaconda stopped working and then started working but spyder stopped working so ended up uninstalling anaconda) – Nima Hojat Oct 21 '22 at 09:39
  • I tried python get-pip.py. it ran successfully , but still have same issue – Nima Hojat Oct 21 '22 at 09:39
  • Did you update your `PATH` environment variable accordingly? Sounds like the typical mess on Windows (sorry...). In general, if you use (Ana)conda, use that to install packages, not pip. Also, don't install any Python versions "manually" alongside Anaconda. – FObersteiner Oct 21 '22 at 09:56
  • Which path variable should I have updated? – Nima Hojat Oct 21 '22 at 10:14
  • See e.g. [here](https://www.educative.io/answers/how-to-add-python-to-path-variable-in-windows). It needs to point to the correct Python installation. Normally, Python installers from https://www.python.org/downloads/ set it automatically (at least if you click the option). But it doesn't hurt to check, to know what's going on. – FObersteiner Oct 21 '22 at 10:28
  • I had a check and it seems the correct python installation is in the path – Nima Hojat Oct 21 '22 at 10:42
  • it *seems* you have set it up correctly, I'm afraid I can suggest nothing more than to clean the temp directory, reboot your PC and try again. related [#1](https://stackoverflow.com/q/26091641/10197418), [#2](https://stackoverflow.com/q/73172243/10197418), [#3](https://stackoverflow.com/q/66432640/10197418) – FObersteiner Oct 21 '22 at 11:01
  • Probably a silly question :) , how do I clean the temp directory and where can I find it? – Nima Hojat Oct 21 '22 at 11:22
  • go to `C:\Users\(my username)\AppData\Local\Temp\\` in Windows explorer and delete everything within that directory. – FObersteiner Oct 21 '22 at 11:41

2 Answers2

0

I downgraded to pip version 22.2.4 and the error went away. I tried downgrading before this post before, but it seems the other version I had downgraded to didnt work. 22.2.4 stopped the error

Nima Hojat
  • 15
  • 6
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 31 '22 at 09:36
0

None of the solutions I found did the trick; I'm still forced to use Python3.6, and upgrading pip, setuptools and wheel made zero difference. Other packages, both of my own and downloaded, installed perfectly.

However, when I did a close read of the setup.py file for the package that produced the error, I found that I'd inadvertently left in a "sys.exit(0)" after finding all the package files and before the setup(...) section.

Thus, if other packages install correctly, check your setup.py file for bugs: you might be shooting yourself in the foot!

ivanlan
  • 979
  • 6
  • 8