install.python-poetry.org icon indicating copy to clipboard operation
install.python-poetry.org copied to clipboard

This "Official Installer Script" fails on Windows

Open alexchandel opened this issue 1 year ago • 6 comments

Installed on an up-to-date vanilla Windows 11 machine with Python 3.13 (symlinks enabled), via the official method recommended right here on the website:

PS C:\Users\me> (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

C:\Users\alexander.chandel\AppData\Roaming\Python\Scripts

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (1.8.4)
Installing Poetry (1.8.4): Creating environment
Installing Poetry (1.8.4): Installing Poetry
Installing Poetry (1.8.4): Creating script
Installing Poetry (1.8.4): Done

Poetry (1.8.4) is installed now. Great!

To get started you need Poetry's bin directory (C:\Users\me\AppData\Roaming\Python\Scripts) in your `PATH`
environment variable.

Alternatively, you can call Poetry explicitly with `C:\Users\me\AppData\Roaming\Python\Scripts\poetry`.

You can test that everything is set up by executing:

`poetry --version`
PS C:\Users\me> C:\Users\me\AppData\Roaming\Python\Scripts\poetry --version
PS C:\Users\me>

Ok so the installation failed somehow. Calling it explicitly outputs nothing. And it did not bother to add that dir to my USER PATH for me, so it isn't really an "install". Let's add it to the PATH and try again:

PS C:\Users\me> poetry --version
PS C:\Users\me> poetry -h
PS C:\Users\me> poetry -foobar
PS C:\Users\me>

No output at all, literally nothing.

Let's try the absolute path, just in case:

PS C:\Users\me> C:\Users\me\AppData\Roaming\pypoetry\venv\Scripts\poetry.exe --version
PS C:\Users\me> C:\Users\me\AppData\Roaming\pypoetry\venv\Scripts\poetry.exe -h
PS C:\Users\me>

Still nothing. What's going on?

alexchandel avatar Nov 19 '24 17:11 alexchandel

I am quite sure that the installer works fine for lots of people: it is likely that whatever problem you are experiencing is something unusual in your local environment.

Do leave an update if and when you figure it out, perhaps the next person will benefit.

dimbleby avatar Nov 19 '24 18:11 dimbleby

eg here it is working fine in CI

dimbleby avatar Nov 20 '24 00:11 dimbleby

https://github.com/python-poetry/install.python-poetry.org/issues/146#issuecomment-2486420042 by https://github.com/dimbleby

I am quite sure that the installer works fine for lots of people: it is likely that whatever problem you are experiencing is something unusual in your local environment.

And? This is relevant in what way?

Do leave an update if and when you figure it out,

The person asked for help and you dismissed them

... perhaps the next person will benefit.

Well, actually, "I am quite sure that the installer works fine for lots of people," so there will not be a "next person" who needs to benefit from the unusual something that the user will figure out for themselves.

hunterhogan avatar Dec 14 '24 03:12 hunterhogan

tldr

Using Python v3.13 is the likely nexus of the problem. Modify the command to

(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -3.12 -

Chronological troubleshooting

About a week ago, I ran (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py - from an admin ps

poetry --version produced nothing I tried using it a few times with things like poetry init but I never got a response or error or anything. for example:

(hhSCNet) C:\apps\hhSCNet>poetry 
(hhSCNet) C:\apps\hhSCNet>poetry --help
(hhSCNet) C:\apps\hhSCNet>poetry help 

Today, I uninstalled with (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py - --uninstall and the script said it was uninstalled. I reinstalled from admin PS. same problem.

Switched to non-admin PS

PowerShell 7.4.6
PS C:\Users\hunte> (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

C:\Users\hunte\AppData\Roaming\Python\Scripts

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (1.8.5)
Installing Poetry (1.8.5): Creating environment
Installing Poetry (1.8.5): Installing Poetry
Installing Poetry (1.8.5): An error occurred. Removing partial environment.
Poetry installation failed.
See C:\Users\hunte\poetry-installer-error-afrdjhr4.log for error logs.

poetry-installer-error-afrdjhr4.log:

Collecting poetry==1.8.5

  Using cached poetry-1.8.5-py3-none-any.whl.metadata (6.9 kB)

Collecting build<2.0.0,>=1.0.3 (from poetry==1.8.5)

  Using cached build-1.2.2.post1-py3-none-any.whl.metadata (6.5 kB)

Collecting cachecontrol<0.15.0,>=0.14.0 (from cachecontrol[filecache]<0.15.0,>=0.14.0->poetry==1.8.5)

  Using cached cachecontrol-0.14.1-py3-none-any.whl.metadata (3.1 kB)

Collecting cleo<3.0.0,>=2.1.0 (from poetry==1.8.5)

  Using cached cleo-2.1.0-py3-none-any.whl.metadata (12 kB)

Collecting crashtest<0.5.0,>=0.4.1 (from poetry==1.8.5)

  Using cached crashtest-0.4.1-py3-none-any.whl.metadata (1.1 kB)

Collecting dulwich<0.22.0,>=0.21.2 (from poetry==1.8.5)

  Using cached dulwich-0.21.7-cp313-cp313t-win_amd64.whl

ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: 'C:\\users\\hunte\\appdata\\local\\pip\\cache\\wheels\\63\\f9\\68\\6bb6145045043643aaf320f7e02bd693edd8db4a4e21472df8\\dulwich-0.21.7-cp313-cp313t-win_amd64.whl'

Check the permissions.

Traceback:

  File "<stdin>", line 937, in main
  File "<stdin>", line 574, in run
  File "<stdin>", line 596, in install
  File "<stdin>", line 699, in install_poetry
  File "<stdin>", line 389, in pip
  File "<stdin>", line 386, in python
  File "<stdin>", line 379, in run

PS C:\Users\hunte> pip cache purge
Files removed: 3738
PS C:\Users\hunte> (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

C:\Users\hunte\AppData\Roaming\Python\Scripts

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (1.8.5)
Installing Poetry (1.8.5): Creating environment
Installing Poetry (1.8.5): Installing Poetry
Installing Poetry (1.8.5): Creating script
Installing Poetry (1.8.5): Done

Poetry (1.8.5) is installed now. Great!

You can test that everything is set up by executing:

`poetry --version`

PS C:\Users\hunte> poetry --version
PS C:\Users\hunte> poetry
PS C:\Users\hunte> poetry --help
PS C:\Users\hunte> poetry help
PS C:\Users\hunte>

(hhSCNet) C:\apps\hhSCNet>py -0
  *               Active venv
 -V:3.13t         Python 3.13 (64-bit, freethreaded)
 -V:3.13          Python 3.13 (64-bit)
 -V:3.12          Python 3.12 (64-bit)
 -V:3.11          Python 3.11 (64-bit)
 -V:3.10          Python 3.10 (64-bit)

(Because I was in a venv when I ran the command, it isn't clear that my default was 3.13)

make %LocalAppData%\py.ini

$pyini = @"
[defaults]
python=3.12
"@
$pyini | Out-File "$env:LocalAppData\py.ini" -Encoding ascii
 C:\Users\hunte>py -0
 -V:3.13t         Python 3.13 (64-bit, freethreaded)
 -V:3.13          Python 3.13 (64-bit)
 -V:3.12 *        Python 3.12 (64-bit)
 -V:3.11          Python 3.11 (64-bit)
 -V:3.10          Python 3.10 (64-bit)
 PowerShell 7.4.6
PS C:\Users\hunte> pip cache purge
Files removed: 231
PS C:\Users\hunte> (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

C:\Users\hunte\AppData\Roaming\Python\Scripts

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (1.8.5)
Installing Poetry (1.8.5): Creating environment
Installing Poetry (1.8.5): Installing Poetry
Installing Poetry (1.8.5): Creating script
Installing Poetry (1.8.5): Done

Poetry (1.8.5) is installed now. Great!

You can test that everything is set up by executing:

`poetry --version`

PS C:\Users\hunte> poetry --version
Poetry (version 1.8.5)

I haven't tried any other command, so maybe it is still broken, but getting a response was major improvement, so I decided to share with y'all.

hunterhogan avatar Dec 14 '24 03:12 hunterhogan

My point in noting that the installer works for lots of people is simply that: it generally isn't true that the installer "fails on windows".

If the script did generally fail, then anyone could reproduce the problem and offer help: whereas if it fails only on the reporter's computer then only the reporter is positioned to do any debugging. (A second report now puts us somewhere in between.)

In an earlier comment I linked to a pipeline succeeding with windows and python 3.13 so the issue is certainly not simply about using python 3.13. I would guess that it's not about that at all; but maybe.

I still have little to offer on this one but encouragement: if you figure out what is going on please do leave an update. Perhaps the next person will benefit.

dimbleby avatar Dec 14 '24 09:12 dimbleby

it generally isn't true that the installer "fails on windows".

  • False: This fails on all Windows systems.
  • True: This fails on my Windows system.
  • True: This fails on a five-USB-port computer.
  • True: This fails on Windows.

The original post can be criticized for many things, but this is not one of them.

A link you might enjoy: prolatio.

hunterhogan avatar Dec 15 '24 01:12 hunterhogan

I can echo the issue, C:\Users\<username>\AppData\Roaming\Python\Scripts isn't even created 3.6 fails with

Installing Poetry (2.1.3): An error occurred. Removing partial environment.
Poetry installation failed.

And then tries to write a log to C:\Users\<username>\AppData\Roaming\, but no such log is ever created 3.13 and 3.12 instead report success, but as I said they don't even create C:\Users\<username>\AppData\Roaming\Python\Scripts

I'm on windows 11

Mek101 avatar Jul 02 '25 08:07 Mek101