Installing with the recommended `install-poetry.py` installer cannot use `poetry self update`
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: Manjaro Linux Ornara 21.0.5
- Poetry version: It says 1.1.6
Issue
I’m trying to install Poetry on a fresh system. I already tried the one in the docs that points to an incorrect install script, but that’s already been reported as a bug (#4128). Then I had to download the bad script properly just so I could run it with the --uninstall
option, rather than piping it into Python.
Then I go to the github page and find the up-to-date install method. I run that script. It stills says that when using this installer I can’t update using self update
. It still says I used the wrong installer.
[cameron@cameron-desktop ~]$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
Retrieving Poetry metadata
This installer is deprecated. Poetry versions installed using this script will not be able to use 'self update' command to upgrade to 1.2.0a1 or later.
# 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:
$HOME/.poetry/bin
This path will then be added to your `PATH` environment variable by
modifying the profile files located at:
$HOME/.profile
$HOME/.bash_profile
You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.
Installing version: 1.1.6
- Downloading poetry-1.1.6-linux.tar.gz (72.33MB)
Poetry (1.1.6) is installed now. Great!
To get started you need Poetry's bin directory ($HOME/.poetry/bin) in your `PATH`
environment variable. Next time you log in this will be done
automatically.
To configure your current shell run `source $HOME/.poetry/env`
[cameron@cameron-desktop ~]$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py > get-poetry.py
[cameron@cameron-desktop ~]$ python get-poetry.py --uninstall
# We are sorry to see you go!
This will uninstall Poetry.
It will remove the `poetry` command from Poetry's bin directory, located at:
$HOME/.poetry/bin
This will also remove Poetry from your system's PATH.
Are you sure you want to uninstall Poetry? (y/[n]) y
[cameron@cameron-desktop ~]$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | 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:
/home/cameron/.local/bin
You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.
You are installing 1.1.6. When using the current installer, this version does not support updating using the 'self update' command. Please use 1.2.0a1 or later.
Installing Poetry (1.1.6): Done
Poetry (1.1.6) is installed now. Great!
You can test that everything is set up by executing:
`poetry --version`
[cameron@cameron-desktop ~]$ poetry --version
Poetry version 1.1.6
[cameron@cameron-desktop ~]$ poetry self update
RuntimeError
Poetry was not installed with the recommended installer. Cannot update automatically.
at .local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/console/commands/self/update.py:248 in _check_recommended_installation
244│ current = Path(__file__)
245│ try:
246│ current.relative_to(self.home)
247│ except ValueError:
→ 248│ raise RuntimeError(
249│ "Poetry was not installed with the recommended installer. "
250│ "Cannot update automatically."
251│ )
252│
[cameron@cameron-desktop ~]$ poetry self update -vvv
Stack trace:
5 .local/share/pypoetry/venv/lib/python3.9/site-packages/clikit/console_application.py:131 in run
129│ parsed_args = resolved_command.args
130│
→ 131│ status_code = command.handle(parsed_args, io)
132│ except KeyboardInterrupt:
133│ status_code = 1
4 .local/share/pypoetry/venv/lib/python3.9/site-packages/clikit/api/command/command.py:120 in handle
118│ def handle(self, args, io): # type: (Args, IO) -> int
119│ try:
→ 120│ status_code = self._do_handle(args, io)
121│ except KeyboardInterrupt:
122│ if io.is_debug():
3 .local/share/pypoetry/venv/lib/python3.9/site-packages/clikit/api/command/command.py:171 in _do_handle
169│ handler_method = self._config.handler_method
170│
→ 171│ return getattr(handler, handler_method)(args, io, self)
172│
173│ def __repr__(self): # type: () -> str
2 .local/share/pypoetry/venv/lib/python3.9/site-packages/cleo/commands/command.py:92 in wrap_handle
90│ self._command = command
91│
→ 92│ return self.handle()
93│
94│ def handle(self): # type: () -> Optional[int]
1 .local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/console/commands/self/update.py:86 in handle
84│ from poetry.repositories.pypi_repository import PyPiRepository
85│
→ 86│ self._check_recommended_installation()
87│
88│ version = self.argument("version")
RuntimeError
Poetry was not installed with the recommended installer. Cannot update automatically.
at .local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/console/commands/self/update.py:248 in _check_recommended_installation
244│ current = Path(__file__)
245│ try:
246│ current.relative_to(self.home)
247│ except ValueError:
→ 248│ raise RuntimeError(
249│ "Poetry was not installed with the recommended installer. "
250│ "Cannot update automatically."
251│ )
252│
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
python - Poetry was not installed with the recommended ...
The error message suggests you've probably installed poetry with pip, which does not support automatic poetry updates.
Read more >Announcing Poetry 1.2.0a1 | Blog
... the self update command. You need to use the new installer script (or either pipx or pip ) to freshly install Poetry....
Read more >poetry 1.1.15 - PyPI
Poetry provides a custom installer that will install poetry isolated from the rest of your system by vendorizing its dependencies. This is the...
Read more >How To Install Poetry to Manage Python Dependencies on ...
txt . In this tutorial you will install Poetry using the official installation script, set up a Poetry project with a virtual environment,...
Read more >Configure a Poetry environment | PyCharm Documentation
To use Poetry in PyCharm, you need to install it on your machine and create a specific Python environment. Install Poetry. Open Terminal...
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
Thread: Here are the reasons this made for a terrible user experience and here is the extremely simple change you could make to fix it.
Project lead: Correct.
On second thought, I’m pretty good with
venv
.I agree. It’s really confusing that the recommended installer on https://python-poetry.org/docs/#installation says “This installer is deprecated”. And even the one in the README says “please use 1.2.0a1 or later” with no instructions on how to get it.