poetry.exe breaks after self upgrade on Windows
See original GitHub issue- I am on the latest Poetry version (sort of).
- 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).
- Windows 10:
- 1.1.13 upgraded to 1.12.0b1:
Issue
When upgrading poetry using poetry self update --preview
, poetry is no longer operable.
Log from a fresh poetry 1.1.13 install:
> (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python - --uninstall
Poetry is not currently installed.
> poetry
Fatal error in launcher: Unable to create process using '"...\AppData\Roaming\pypoetry\venv\Scripts\python.ex
> (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
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:
...\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.1.13)
Installing Poetry (1.1.13): Creating environment
Installing Poetry (1.1.13): Installing Poetry
Installing Poetry (1.1.13): Creating script
Installing Poetry (1.1.13): Done
Poetry (1.1.13) is installed now. Great!
`poetry --version`
> poetry --version
Poetry version 1.1.13
> poetry self --help
USAGE
poetry self
or: poetry self update [--preview] [<version>]
COMMANDS
update
Updates Poetry to the latest version.
<version> The version to update to.
--preview Install prereleases.
GLOBAL OPTIONS
-h (--help) Display this help message
-q (--quiet) Do not output any message
-v (--verbose) Increase the verbosity of messages: "-v" for normal output, "-vv" for more verbose output and
"-vvv" for debug
-V (--version) Display this application version
-n (--no-interaction) Do not ask any interactive question
> poetry self update --preview
Updating Poetry to 1.2.0b1
Updating dependencies
Resolving dependencies...
Package operations: 1 install, 3 updates, 0 removals
- Updating cleo (0.8.1 -> 1.0.0a4)
- Installing entrypoints (0.3)
- Updating poetry-core (1.0.8 -> 1.1.0a7)
- Updating poetry (1.1.13 -> 1.2.0b1)
Updating the poetry script
Poetry (1.2.0b1) is installed now. Great!
> poetry --version
Traceback (most recent call last):
File "...\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "...\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "...\AppData\Roaming\Python\Scripts\poetry.exe\__main__.py", line 4, in <module>
ImportError: cannot import name 'main' from 'poetry.console' (...\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\console\__init__.py)
> (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python - --uninstall
Removing Poetry (1.1.13)
I needed to update to 1.2.0b1
due to the bug where I could not install CUDA versions of TorchVision and PyTorch together, but this unfortunately seems to have completely bricked my poetry install, requiring a manual deletion of remaining files.
A fully fresh install with (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python - --version 1.2.0b1
does seem to work, however.
> (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python - --version 1.2.0b1
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:
...\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.2.0b1)
Installing Poetry (1.2.0b1): Creating environment
Installing Poetry (1.2.0b1): Installing Poetry
Installing Poetry (1.2.0b1): Creating script
Installing Poetry (1.2.0b1): Done
Poetry (1.2.0b1) is installed now. Great!
You can test that everything is set up by executing:
`poetry --version`
> poetry --version
Poetry (version 1.2.0b1)
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:17 (2 by maintainers)
Top Results From Across the Web
Announcing Poetry 1.2.0 | Blog
Since there are many changes in Poetry 1.2.0, this post details the changes over the following sections: Breaking changes and major features ...
Read more >Poetry - RuntimeError: No python executable found in shell ...
Poetry versions installed using this script will not be able to use 'self update' command to upgrade to 1.2.0a1 or later.
Read more >Ask HN: Why Poetry did not become a mainstream package ...
Upgrading can be done by installing a later version of the package and rewriting the requirements file. I suspect my use cases haven't...
Read more >install-poetry.py - GitHub
_path.joinpath("Scripts/python.exe" if WINDOWS else "bin/python") ) @property def path(self): return self._path @classmethod def make(cls, target: 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. Poetry replaces ...
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’m on Windows 11 running Python 3.8 installed from python.org with
py.exe
supportpoetry.exe
from path$env:APPDATA\Python\Scripts
has no updated timestamp$env:APPDATA\pypoetry\poetry.exe
$env:APPDATA\pypoetry\venv\Lib\site-packages\poetry
As it is hard on Windows to compare who installed which Python (Microsoft Store vs python.org) your mileage (folder locations) may vary.
exe
to theScript
folder is all what is missing on Windows?This is an issue in the
1.2.0
version also. Just ranpoetry self update
and now get this error: