Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing with the recommended install-poetry.py installer cannot use poetry self update #4147

Closed
3 tasks done
ckp95 opened this issue Jun 6, 2021 · 7 comments · Fixed by #4249
Closed
3 tasks done

Comments

@ckp95
Copy link

ckp95 commented Jun 6, 2021

  • 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│ 

@ckp95 ckp95 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jun 6, 2021
@abn
Copy link
Member

abn commented Jun 6, 2021

From the logs above (we should probably improve it to be more attention grabbing I think).

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.

Duplicate of #4146

@abn abn added Installer and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jun 6, 2021
@ckp95
Copy link
Author

ckp95 commented Jun 6, 2021

So is it just impossible to update from 1.1.6 to 1.2.x using self update? If it's giving the same message for both installers ...

@ChanceNCounter
Copy link

To clarify:

The docs still tell you to use the old get-poetry.py, which installs 1.1.6 and offers this feedback, including, "When using the current installer..."
README tells you to use the current install-poetry.py which installs 1.1.6 and offers identical feedback.

The only way not to get this feedback is to install the apparently unreleased 1.2 by running the installer with the --preview flag, which I only discovered by clicking the duplicate issue linked above and reading the comments. Apparently that info is in README, but it's not near the disclaimer about an old and a new install script. It's down in the meat and potatoes of a detailed description of what the script can do.

The script which we have just been advised not to download, but rather to pipe through.

Also, if the deprecated installer can be updated to throw that warning, surely it could also pause at that point and offer the option to abort.

@0xallie
Copy link

0xallie commented Jun 14, 2021

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.

@finswimmer
Copy link
Member

So is it just impossible to update from 1.1.6 to 1.2.x using self update?

Correct. It is planned to change the underlying code for self update in the next release of 1.1 so that it will be possible poetry was installed with the install-poetry.py script.

fin swimmer

@ChanceNCounter
Copy link

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.

Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants