Here is the output of pipenv --support | clip:
The path which is causing the error may have existed on my Windows 10 PC, but thefolder C:/Program Files/Python351 no longer exists on my PC. I do not understand where pipenv finds a reference to this non-existing folder and I do not know how to solve this problem.
I have been successfully using the following command to create a virtual env for several new django projects:
pipenv install django>=3.0
but now running this command gives this valueerror.
G:\Documenten\python_projects\django_for_beginners_projects\newspaper_pycharmproject
位 pipenv --support | clip
Traceback (most recent call last):
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 618, in parse_executable
result_version = get_python_version(path)
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\pythonfinder\utils.py", line 105, in get_python_version
c = subprocess.Popen(version_cmd, **subprocess_kwargs)
File "c:\users\martin\appdata\local\programs\python\python38-32\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "c:\users\martin\appdata\local\programs\python\python38-32\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] Het systeem kan het opgegeven bestand niet vinden
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\martin\appdata\local\programs\python\python38-32\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\martin\appdata\local\programs\python\python38-32\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Scripts\pipenv.exe\__main__.py", line 7, in <module>
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 1236, in invoke
return Command.invoke(self, ctx)
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "c:\users\martin\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\cli\command.py", line 139, in cli
get_pipenv_diagnostics()
File "c:\users\martin\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\help.py", line 33, in get_pipenv_diagnostics
python_paths = finder.find_all_python_versions()
File "c:\users\martin\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\vendor\pythonfinder\pythonfinder.py", line 312, in find_all_python_versions
python_version_dict = getattr(self.system_path, "python_version_dict", {})
File "c:\users\martin\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\vendor\pythonfinder\pythonfinder.py", line 120, in system_path
self._system_path = self.create_system_path()
File "c:\users\martin\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\vendor\pythonfinder\pythonfinder.py", line 82, in create_system_path
return pyfinder_path.SystemPath.create(
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\pythonfinder\models\path.py", line 682, in create
instance = instance._run_setup()
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\pythonfinder\models\path.py", line 233, in _run_setup
new_instance = new_instance._setup_windows()
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\pythonfinder\models\path.py", line 411, in _setup_windows
windows_finder = WindowsFinder.create()
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\pythonfinder\models\windows.py", line 146, in create
return cls()
File "<attrs generated init pythonfinder.models.windows.WindowsFinder>", line 13, in __init__
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\pythonfinder\models\windows.py", line 113, in get_versions
versions[py_version.version_tuple[:5]] = base_dir
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 365, in __getattribute__
result = super(PythonVersion, self).__getattribute__(key)
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 430, in version_tuple
self.patch,
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 375, in __getattribute__
instance_dict = self.parse_executable(executable)
File "C:\Users\Martin\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 620, in parse_executable
raise ValueError("Not a valid python path: %r" % path)
ValueError: Not a valid python path: 'C:/Program Files/Python351/python.exe'
You are likely to have some stale entries of previously installed pythons in the registry.
My advice to you:
look for Python351 in regedit (win+r , regedit)
and delete the entries (their content)
Yes, Idan, I have already been searching for Python351 in regedit, but unfortunately not a single search result was found, searching through the complete registry. So I do not understand at all where the mention of Python351 is coming from. There was a directory from a previous python installation, but I removed that directory and still the reference to Python351 comes up in the errormessage. Anyone having an idea on how to solve this?
I have the same issue. I've scanned my registry for loose entries but haven't found any. It appears that the pythonfinder is just looking through locations/versions. If I place Python27 there, it simply looks for Python26. If I place Python26, then it looks and fails to find Python25.
PS D:\Downloads\resq-takehome-starter\backend> pipenv install django-cors-headers
<details><summary>$ pipenv --support</summary>
**Pipenv version: `'2020.6.2'`
Pipenv location: `'C:\\Users\\myself\\AppData\\Roaming\\Python\\Python38\\site-packages\\pipenv'`
Python location: `'c:\\program files\\python38\\python.exe'`
Python installations found:**
Traceback (most recent call last):
File "C:\Users\myself\AppData\Roaming\Python\Python38\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 618, in parse_executable
result_version = get_python_version(path)
File "C:\Users\myself\AppData\Roaming\Python\Python38\site-packages\pipenv\vendor\pythonfinder\utils.py", line 105, in get_python_version
c = subprocess.Popen(version_cmd, **subprocess_kwargs)
File "c:\program files\python38\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "c:\program files\python38\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
...
File "C:\Users\myself\AppData\Roaming\Python\Python38\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 375, in __getattribute__
instance_dict = self.parse_executable(executable)
File "C:\Users\myself\AppData\Roaming\Python\Python38\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 620, in parse_executable
raise ValueError("Not a valid python path: %r" % path)
ValueError: Not a valid python path: 'C:/Python27/Scripts/python.exe'
Having the same issue, no registry keys found that point to 'C:/Python27/Scripts/python.exe'
I was having a similar issue with pipenv and getting the same error messages. Searching regedit did pull up some random entries to an uninstalled version of Python which I deleted. I stopped getting the error messages when I went back and installed the version of Python that was being mentioned (in martin's case that would be 3.5.1) in the same location that pipenv was trying to find the directory. Then, I uninstalled it using the installation exe and it cleared up my issues with pipenv. I hope that helps!
Here is the output of pipenv --support | clip:
The path which is causing the error may have existed on my Windows 10 PC, but thefolder C:/Program Files/Python351 no longer exists on my PC. I do not understand where pipenv finds a reference to this non-existing folder and I do not know how to solve this problem.I have been successfully using the following command to create a virtual env for several new django projects:
pipenv install django>=3.0
but now running this command gives this valueerror.I will very much appreciate a solution to my problem.
G:\Documentenpython_projects\django_for_beginners_projects\newspaper_pycharmproject
位 pipenv --support | clip
Traceback (most recent call last):
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspython.py", line 618, in parse_executable
result_version = get_python_version(path)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\utils.py", line 105, in get_python_version
c = subprocess.Popen(version_cmd, subprocess_kwargs)
File "c:users\martin\appdata\local\programspythonpython38-32\libsubprocess.py", line 854, in **init
self._execute_child(args, executable, preexec_fn, close_fds,
File "c:users\martin\appdata\local\programspythonpython38-32\libsubprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] Het systeem kan het opgegeven bestand niet vindenDuring handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:users\martin\appdata\local\programspythonpython38-32\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:users\martin\appdata\local\programspythonpython38-32\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Scripts\pipenv.exe__main__.py", line 7, in
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 829, in call
return self.main(args, kwargs)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 1236, in invoke
return Command.invoke(self, ctx)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, *ctx.params)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 610, in invoke
return callback(args, *kwargs)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\decorators.py", line 73, in new_func
return ctx.invoke(f, obj, args, *kwargs)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 610, in invoke
return callback(args, *kwargs)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\decorators.py", line 21, in new_func
return f(get_current_context(), args, *kwargs)
File "c:users\martin\appdata\local\programspythonpython38-32\lib\site-packages\pipenv\cli\command.py", line 139, in cli
get_pipenv_diagnostics()
File "c:users\martin\appdata\local\programspythonpython38-32\lib\site-packages\pipenv\help.py", line 33, in get_pipenv_diagnostics
python_paths = finder.find_all_python_versions()
File "c:users\martin\appdata\local\programspythonpython38-32\lib\site-packages\pipenv\vendorpythonfinderpythonfinder.py", line 312, in find_all_python_versions
python_version_dict = getattr(self.system_path, "python_version_dict", {})
File "c:users\martin\appdata\local\programspythonpython38-32\lib\site-packages\pipenv\vendorpythonfinderpythonfinder.py", line 120, in system_path
self._system_path = self.create_system_path()
File "c:users\martin\appdata\local\programspythonpython38-32\lib\site-packages\pipenv\vendorpythonfinderpythonfinder.py", line 82, in create_system_path
return pyfinder_path.SystemPath.create(
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspath.py", line 682, in create
instance = instance._run_setup()
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspath.py", line 233, in _run_setup
new_instance = new_instance._setup_windows()
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspath.py", line 411, in _setup_windows
windows_finder = WindowsFinder.create()
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\models\windows.py", line 146, in create
return cls()
File "", line 13, in **init
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\models\windows.py", line 113, in get_versions
versions[py_version.version_tuple[:5]] = base_dir
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspython.py", line 365, in getattribute
result = super(PythonVersion, self).getattribute(key)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspython.py", line 430, in version_tuple
self.patch,
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspython.py", line 375, in getattribute
instance_dict = self.parse_executable(executable)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspython.py", line 620, in parse_executable
raise ValueError("Not a valid python path: %r" % path)
ValueError: Not a valid python path: 'C:/Program Files/Python351/python.exe'
As a guy said below just go to regedit. Search all folders for python. If you have two -like i had- check the paths. Probably the older one causes you this problem. In my case i had the 3.5 with path linked to Anaconda. I deleted it and now pipenv works fine for me.
Here is the output of pipenv --support | clip:
The path which is causing the error may have existed on my Windows 10 PC, but thefolder C:/Program Files/Python351 no longer exists on my PC. I do not understand where pipenv finds a reference to this non-existing folder and I do not know how to solve this problem.
I have been successfully using the following command to create a virtual env for several new django projects:
pipenv install django>=3.0
but now running this command gives this valueerror.I will very much appreciate a solution to my problem.
G:\Documentenpython_projects\django_for_beginners_projects\newspaper_pycharmproject
位 pipenv --support | clip
Traceback (most recent call last):
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspython.py", line 618, in parse_executable
result_version = get_python_version(path)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\utils.py", line 105, in get_python_version
c = subprocess.Popen(version_cmd, subprocess_kwargs)
File "c:users\martin\appdata\local\programspythonpython38-32\libsubprocess.py", line 854, in *init
self._execute_child(args, executable, preexec_fn, close_fds,
File "c:users\martin\appdata\local\programspythonpython38-32\libsubprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] Het systeem kan het opgegeven bestand niet vinden
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:users\martin\appdata\local\programspythonpython38-32\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:users\martin\appdata\local\programspythonpython38-32\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Scripts\pipenv.exe__main__.py", line 7, in
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 829, in call
return self.main(args, kwargs)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 1236, in invoke
return Command.invoke(self, ctx)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, *ctx.params)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 610, in invoke
return callback(args, *kwargs)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, *kwargs)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\core.py", line 610, in invoke
return callback(args, *kwargs)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendor\click\decorators.py", line 21, in new_func
return f(get_current_context(), args, *kwargs)
File "c:users\martin\appdata\local\programspythonpython38-32\lib\site-packages\pipenv\cli\command.py", line 139, in cli
get_pipenv_diagnostics()
File "c:users\martin\appdata\local\programspythonpython38-32\lib\site-packages\pipenv\help.py", line 33, in get_pipenv_diagnostics
python_paths = finder.find_all_python_versions()
File "c:users\martin\appdata\local\programspythonpython38-32\lib\site-packages\pipenv\vendorpythonfinderpythonfinder.py", line 312, in find_all_python_versions
python_version_dict = getattr(self.system_path, "python_version_dict", {})
File "c:users\martin\appdata\local\programspythonpython38-32\lib\site-packages\pipenv\vendorpythonfinderpythonfinder.py", line 120, in system_path
self._system_path = self.create_system_path()
File "c:users\martin\appdata\local\programspythonpython38-32\lib\site-packages\pipenv\vendorpythonfinderpythonfinder.py", line 82, in create_system_path
return pyfinder_path.SystemPath.create(
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspath.py", line 682, in create
instance = instance._run_setup()
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspath.py", line 233, in _run_setup
new_instance = new_instance._setup_windows()
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspath.py", line 411, in _setup_windows
windows_finder = WindowsFinder.create()
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\models\windows.py", line 146, in create
return cls()
File "", line 13, in **init
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\models\windows.py", line 113, in get_versions
versions[py_version.version_tuple[:5]] = base_dir
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspython.py", line 365, in getattribute
result = super(PythonVersion, self).getattribute(key)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspython.py", line 430, in version_tuple
self.patch,
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspython.py", line 375, in getattribute
instance_dict = self.parse_executable(executable)
File "C:\Users\MartinAppData\Local\Programs\Python\Python38-32\Lib\site-packages\pipenv\vendorpythonfinder\modelspython.py", line 620, in parse_executable
raise ValueError("Not a valid python path: %r" % path)
ValueError: Not a valid python path: 'C:/Program Files/Python351/python.exe'As a guy said below just go to regedit. Search all folders for python. If you have two -like i had- check the paths. Probably the older one causes you this problem. In my case i had the 3.5 with path linked to Anaconda. I deleted it and now pipenv works fine for me.
Hi, I am getting the same problem with path linked to Anaconda. How did you find the path and delete it? Thanks
Someone suggested to use an older version in another thread.
pip install pipenv==2018.10.13
It fixed the issue for me, before I was also stuck on the Anaconda path
I'm not using Anaconda but facing the same problem. I think we need to clear the pipenv cache and install it again. Can somebody help me in clearing cache.
Anyone facing a similar error needs to uninstall old python versions
C:\Windows\regedit.exe
HKLM\SOFTWARE\Python\PythonCore\
HKCU\SOFTWARE\Python\PythonCore\
Had the same issue today (pipenv 2020.08.13) and following @snooppr instructions solved the issue
To add to @snooppr, I had to look in
HKLM\SOFTWARE\WOW6432Node\Python\PythonCore\
HKCU\SOFTWARE\WOW6432Node\Python\PythonCore\
as well.
Anyone facing a similar error needs to uninstall old python versions
C:\Windows\regedit.exe
HKLM\SOFTWARE\Python\PythonCore
HKCU\SOFTWARE\Python\PythonCore\
Worked for me as well, I deleted all the folders of the python versions I was not using, and then it worked! Thanks 馃憤
Most helpful comment
Anyone facing a similar error needs to uninstall old python versions
C:\Windows\regedit.exe
HKLM\SOFTWARE\Python\PythonCore\
HKCU\SOFTWARE\Python\PythonCore\