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 self update not updating poetry (new version available) properly. poetry --version showing old version

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.

  • Poetry version: 1.1.9

Issue

When poetry self update is ran, it doesn’t update poetry properly. It is showing old version for command poetry --version instead of showing new version

Minimal steps to reproduce

  1. Run new docker python image docker run -it python bash
  2. Install poetry curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -
  3. export PATH="/root/.local/bin:$PATH"
  4. poetry --version Poetry version 1.1.9
  5. Run self update to preview poetry self update --preview
  6. Rerun poetry --version It shows Poetry version 1.1.9 instead of preview version

This issue is also present when updating poetry from 1.1.8 to 1.1.9. Other version not tested

Full steps

$ docker run -it python bash
root@aeac3f8b58ef:/# 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:

/root/.local/bin

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

Installing Poetry (1.1.9): Done

Poetry (1.1.9) is installed now. Great!

To get started you need Poetry's bin directory (/root/.local/bin) in your `PATH`
environment variable.

Add `export PATH="/root/.local/bin:$PATH"` to your shell configuration file.

Alternatively, you can call Poetry explicitly with `/root/.local/bin/poetry`.

You can test that everything is set up by executing:

`poetry --version`

root@aeac3f8b58ef:/# export PATH="/root/.local/bin:$PATH"
root@aeac3f8b58ef:/# poetry --version
Poetry version 1.1.9
root@aeac3f8b58ef:/# poetry self update --preview
Updating Poetry to 1.2.0a2

Updating dependencies
Resolving dependencies... (3.5s)

Package operations: 36 installs, 0 updates, 0 removals

  - Installing certifi (2021.5.30)
  - Installing charset-normalizer (2.0.6)
  - Installing cryptography (3.4.8)
  - Installing idna (3.2)
  - Installing jeepney (0.7.1)
  - Installing urllib3 (1.26.6)
  - Installing zipp (3.5.0)
  - Installing appdirs (1.4.4)
  - Installing crashtest (0.3.1)
  - Installing distlib (0.3.2)
  - Installing filelock (3.0.12)
  - Installing importlib-metadata (4.8.1)
  - Installing lockfile (0.12.2)
  - Installing msgpack (1.0.2)
  - Installing ptyprocess (0.7.0)
  - Installing pylev (1.4.0)
  - Installing pyparsing (2.4.7)
  - Installing requests (2.26.0)
  - Installing secretstorage (3.3.1)
  - Installing six (1.16.0)
  - Installing webencodings (0.5.1)
  - Installing cachecontrol (0.12.6)
  - Installing cachy (0.3.0)
  - Installing cleo (1.0.0a4)
  - Installing entrypoints (0.3)
  - Installing html5lib (1.1)
  - Installing keyring (23.2.1)
  - Installing packaging (20.9)
  - Installing pexpect (4.8.0)
  - Installing pkginfo (1.7.1)
  - Installing poetry-core (1.1.0a6)
  - Installing requests-toolbelt (0.9.1)
  - Installing shellingham (1.4.0)
  - Installing tomlkit (0.7.2)
  - Installing virtualenv (20.4.4)
  - Installing poetry (1.2.0a2)

Updating the poetry script

Poetry (1.2.0a2) is installed now. Great!
root@aeac3f8b58ef:/# poetry --version
Poetry version 1.1.9
root@aeac3f8b58ef:/# 

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:9
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
pietrodncommented, Sep 22, 2021

It happened again after running poetry self update from Poetry 1.1.9. It says it updated Poetry to 1.1.10, but poetry --version returns 1.0.9.

Running the install script again fixes the issue, installing Poetry 1.1.10.

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -
1reaction
cbinicommented, Sep 20, 2021

On 1.1.9, poetry self update also throws a RuntimeError “Poetry was not installed with the recommended installer. Cannot update automatically.” even though I have used the recommended installer. Just to be sure, I uninstalled poetry and then reinstalled with the new installer, and I’m still getting the error.

Here’s the full traceback:

RuntimeError

  Poetry was not installed with the recommended installer. Cannot update automatically.

  at .pyenv/versions/3.9.7/lib/python3.9/site-packages/poetry/console/commands/self/update.py:389 in _check_recommended_installation
      385│         current = Path(__file__)
      386│         try:
      387│             current.relative_to(self.home)
      388│         except ValueError:
    → 389│             raise RuntimeError(
      390│                 "Poetry was not installed with the recommended installer. "
      391│                 "Cannot update automatically."
      392│             )
      393│
Read more comments on GitHub >

github_iconTop Results From Across the Web

Introduction | Documentation | Poetry - Python dependency ...
Introduction Poetry is a tool for dependency management and packaging in Python. ... a specific version, you can pass it as an argument...
Read more >
poetry - PyPI
Documentation for the current version of Poetry (as well as the development branch and recently out of support versions) is available from the...
Read more >
pyenv: poetry itself, running on older python version, what to do?
By default Poetry will use the Python version used during it installation to create a new venv. Set the (experimental) config option ...
Read more >
Update Packages in Python Poetry - YippeeCode
Well, Poetry is smart enough to detect if the package already exists in your system. It does not mean that it will keep...
Read more >
Announcing Poetry 1.2.0 -- Python dependency management ...
Now, they aren't allowing users to install the new poetry versions with the old installer and people using the old installer will get...
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