pipenv search python in old directory do not exist

Viewed 814

I would to create new Python project which include pipenv for manage my packages.

But when I try to install package with it, it throw me I exception :

ValueError: Not a valid python path: 'C:/dev/Anaconda3/Scripts/python.exe'

I try pipenv command with 2 differents emulation terminal (Cmder and Terminus) which produce same result.

In old time a try Anaconda solutions for work with Python. But now I don't want use this and I uninstall Anaconda in my OS.

It seems that my OS keep old reference to this python executable into Anaconda in your PATH... But I display my 2 PATH variables OS (PATH system OS and PATH user) and nothing has this location path into your string.

The directory c:\dev\Anaconda3 doesn't exist !

I try to search uninstall Anaconda program in my tool application manager Windows but Anaconda is not diplayed in that listing. It seems to be good uninstalled.

I install correctly pipenv executable : pipenv --version

pipenv, version 2020.6.2

I install correctly python executable : python --version

Python 3.8.3

I added 3 differents PATH python for my OS PATH (system PATH and user PATH) :

  • C:\dev\python\Python38
  • C:\dev\python\Python38\Scripts\
  • C:\dev\python\Python38\Scripts\bin

Why I keep old reference to Anaconda program ?

Why many program search python in same old deleted path and PATH variable do not included this ?

How pipenv created his PATH environment variable ?

3 Answers

I had a Python2.7 instance giving me the same problem. I copy/pasted its python.exe into the Scripts folder. So it now found a real python.exe there. Once I did this it continued on happily. And now I was able to use the Python3.9 version i wanted it to use anyways.

It seems like the python searcher should be a little more tolerant and just ignore poorly formed python releases. There is an open ticket for this: https://github.com/pypa/pipenv/issues/4334

I had a similar error because of an incorrectly uninstalled Anaconda. To see if you have the same problem, go to System Settings > Add or remove programs, and check for anything unexpected matching "conda". Trying to uninstall it results in an error because the uninstall.exe file cannot be found.

Searching around, I saw a few posts that said to mess with regedit, but that's scary. Instead, I re-installed the version of Anaconda that I needed to uninstall (you can do that with https://repo.anaconda.com/archive/Anaconda3-2020.02-Windows-x86_64.exe, replacing 2020.02 with your Anaconda version), and then uninstalling it via the proper uninstaller via "Add or remove programs". After a restart, the phantom Anaconda python was gone

You need to delete the old path in the Windows Registry.

  • Hit win + r
  • regedit
  • find folders with (Anaconda3 or Miniconda3).

Probably two folders. Do not delete folders with the new path to Python.

Related