question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 (-vvv option).
  • 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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
eapetitfilscommented, Feb 12, 2021

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 using shell=True. You can reproduce the same error directly in the command prompt by doing:

cmd.exe /c "python --version"
echo %errorlevel%

Command Prompt Bug Check

The way I fixed it is described on StackOverflow: Open regedit.exe, navigate to Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor and 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.

1reaction
neersightedcommented, Oct 18, 2022

python-poetry/install.python-poetry.org#46

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found