Poetry installation fails. Windows 10, python39
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption).
- OS version and name: Windows 10 Education edition
- Poetry version: 1.1.4
- Link of a [Gist] with the contents of your pyproject.toml file: N/A
- Python version: 3.9
Issue
Poetry install fails on windows 10, both recommended installation (powershell) and Pip installation fail. Both methods have been tried in user and admin powershell consoles. My $PATH is correct.
PS C:\Users\me\workspace> (Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python -
Retrieving Poetry metadata
Welcome to Poetry!
... ... ... omitted
Installing version: 1.1.4
- Downloading poetry-1.1.4-win32.tar.gz (38.82MB)
Traceback (most recent call last):
File "<stdin>", line 1086, in <module>
File "<stdin>", line 1082, in main
File "<stdin>", line 362, in run
File "<stdin>", line 529, in install
File "<stdin>", line 676, in make_bin
File "<stdin>", line 665, in _which_python
RuntimeError: No python executable found in shell environment. Tried: ['python', 'python3', 'py.exe -3', 'py.exe -2']
PS C:\Users\me\workspace> python --version
Python 3.9.0
PS C:\Users\me\workspace> pip install poetry --no-cache
... ... ... omitted
Installing collected packages: tomlkit, pylev, pastel, clikit, cleo, msgpack, lockfile, cachecontrol, poetry-core, cachy, filelock, appdirs, distlib, virtualenv, shellingham, webencodings, html5lib, pkginfo, poetry
Running setup.py install for msgpack ... done
WARNING: Failed to write executable - trying to use .deleteme logic
ERROR: Could not install packages due to an EnvironmentError: [WinError 2] The system cannot find the file specified: 'c:\\python39\\Scripts\\doesitcache.exe' -> 'c:\\python39\\Scripts\\doesitcache.exe.deleteme'
The powershell installation method tells me that it is unable to find my python executable, but it is certainly in my global PATH. Using the Pip installation method will result in it being unable to find an exe in “python39/scripts”. Running the pip installation again it tells me it can’t find a different exe before installation terminates. Indeed, these executables are not in that directory.
These installation methods will place a .poetry directory skeleton in my home, but will not place an executable for poetry in .poetry/bin
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:13 (3 by maintainers)
Top Results From Across the Web
python poetry installation failed on Windows 10 - no pyvenv ...
This indeed is path issue with multiple versions of Python Installation , especially the version from Microsoft is not setting the path ...
Read more >poetry - PyPI
Poetry helps you declare, manage and install dependencies of Python projects, ensuring you have the right stack everywhere. Poetry Install.
Read more >Introduction | master | Documentation | Poetry - Python ...
We provide a custom installer that will install Poetry in a new virtual environment to isolate it from the rest of your system....
Read more >Installing the Python Connector - Snowflake Documentation
This topic provides instructions for installing the Snowflake Connector for Python. The connector can currently be installed in Linux, macOS, and Windows ......
Read more >Install spaCy · spaCy Usage Documentation
See notes on Ubuntu, macOS / OS X and Windows for details. python -m pip install -U pip setuptools wheel # install/update build...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I fixed the issue properly on my side, this was not a poetry problem, but rather an old installation of Anaconda not properly cleaned up.
Basically, whenever I was starting a command prompt in Windows, there was a message
The system cannot find the path specified.. I was not alarmed as everything else was working. However, it does change the exit status to 1 instead of 0 when calling something with subprocess if usingshell=True. You can reproduce the same error directly in the command prompt by doing:The way I fixed it is described on StackOverflow: Open regedit.exe, navigate to
Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processorand make sure the value of the Autorun key exists. If not, clear the value. In my case, I had an entry for an Anaconda batch file that did not exist anymore.While this error is not related to Poetry, maybe it would be interested to document it if the root cause is similar for other people.
python-poetry/install.python-poetry.org#46