Skip to content

install-poetry.py - Poetry was not installed with the recommended installer.  #4040

@posidron

Description

@posidron
  • 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: Windows 10
  • Poetry version: 1.1.6

Issue

I used to install poetry via pip which worked fine for build and publish, however installing from a private registry failed with whatever I tried with "package with version is not available" error and hence tried the official installer to be able to use the preview version in hopes it's a bug and it might have been fixed.

I downloaded the install-poetry.py and installed it again via this script.

> python .\install-poetry.py
[ Added AppData to Path ]
> poetry self update --preview

  RuntimeError

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

  at c:\users\FOO\appdata\roaming\pypoetry\venv\lib\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│

It should not tell me that I did not install it with the recommended installer I believe.

C:\Users\FOO\AppData\Roaming\Python\Scripts\poetry.exe self update -vvv

  Stack trace:

  5  c:\users\FOO\appdata\roaming\pypoetry\venv\lib\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  c:\users\FOO\appdata\roaming\pypoetry\venv\lib\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  c:\users\FOO\appdata\roaming\pypoetry\venv\lib\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  c:\users\FOO\appdata\roaming\pypoetry\venv\lib\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  c:\users\FOO\appdata\roaming\pypoetry\venv\lib\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 c:\users\FOO\appdata\roaming\pypoetry\venv\lib\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│

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions