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

Time:11-03

How to I upgrade to the latest version?

Specification:

  • Windows 10,
  • Visual Studio Code,
  • Ubuntu Bash.

Current Version:

me@PF2DCSXD:/mnt/c/Users/user/Documents/GitHub/workers-python/workers/composite_key/compositekey/tests$ python3 --version
Python 3.8.10

Attempt to update | poetry self update:

me@PF2DCSXD:/mnt/c/Users/user/Documents/GitHub/workers-python/workers/composite_key/compositekey/tests$ poetry self update

  RuntimeError

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

  at ~/.local/lib/python3.8/site-packages/poetry/console/commands/self/update.py:389 in _check_recommended_installation
      385│         current = Path(__file__)
      386try:
      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

Please let me know if there is anything else I can add to post.

CodePudding user response:

The error message suggests you've probably installed poetry with pip, which does not support automatic poetry updates. You should uninstall the poetry version currently installed, and reinstall it using the recommended method, which uses a custom installation script.

On osx/linux, you'll just have to run curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - to download and run this installation script.

  • Related