python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.17k stars 2.25k forks source link

Poetry uses incorrect Python #1470

Closed pikeas closed 4 years ago

pikeas commented 4 years ago

Issue

Possibly related: https://github.com/sdispater/poetry/issues/439#issuecomment-423574924, https://github.com/sdispater/poetry/issues/536, https://github.com/sdispater/poetry/issues/988, https://github.com/sdispater/poetry/issues/1386.

$ python -V
3.7.4
$ poetry install -vvv

[RuntimeError]
The current Python version (3.8.0) is not supported by the project (~3.7)
Please activate a compatible Python version.

Traceback (most recent call last):
  File "/Users/pikeas/.local/pipx/venvs/poetry==1.0.0.b2/lib/python3.8/site-packages/clikit/console_application.py", line 132, in run
    status_code = command.handle(parsed_args, io)
  File "/Users/pikeas/.local/pipx/venvs/poetry==1.0.0.b2/lib/python3.8/site-packages/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/Users/pikeas/.local/pipx/venvs/poetry==1.0.0.b2/lib/python3.8/site-packages/clikit/api/command/command.py", line 165, in _do_handle
    self._dispatcher.dispatch(ConsoleEvents.PRE_HANDLE.value, event)
  File "/Users/pikeas/.local/pipx/venvs/poetry==1.0.0.b2/lib/python3.8/site-packages/clikit/api/event/event_dispatcher.py", line 22, in dispatch
    self._do_dispatch(listeners, event_name, event)
  File "/Users/pikeas/.local/pipx/venvs/poetry==1.0.0.b2/lib/python3.8/site-packages/clikit/api/event/event_dispatcher.py", line 89, in _do_dispatch
    listener(event, event_name, self)
  File "/Users/pikeas/.local/pipx/venvs/poetry==1.0.0.b2/lib/python3.8/site-packages/poetry/console/config/application_config.py", line 84, in set_env
    raise RuntimeError(

Poetry is installed under Python 3.8, the currently activated Python is 3.7, and pyproject.toml has Python pinned to ~3.7 (rather than the more common ^3.7).

I expected Poetry to use the active version of Python, instead it uses the version of Python it was installed under, which fails.

sdispater commented 4 years ago

Duplicate of #536 which is currently being fixed.

github-actions[bot] commented 6 months ago

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.