Open EliseevEgor opened 1 month ago
probably duplicate https://github.com/python-poetry/poetry/pull/9286? try with the main branch, please close
I tried it with Poetry 1.8.3. Bug is still reproducing.
https://github.com/python-poetry/poetry/pull/9286 was merged on Apr 9. 1.8.3 was published on May 8.
Ok. In 1.9.0.dev0
bug is still reproducing
Traceback (most recent call last):
File ".../Library/Caches/pypoetry/virtualenvs/poetry-py3.12/lib/python3.12/site-packages/cleo/application.py", line 327, in run
File ".../poetry/src/poetry/console/application.py", line 180, in _run
exit_code: int = super()._run(io)
^^^^^^^^^^^^^^^^
File ".../Library/Caches/pypoetry/virtualenvs/poetry-py3.12/lib/python3.12/site-packages/cleo/application.py", line 431, in _run
File ".../Library/Caches/pypoetry/virtualenvs/poetry-py3.12/lib/python3.12/site-packages/cleo/application.py", line 473, in _run_command
File ".../Library/Caches/pypoetry/virtualenvs/poetry-py3.12/lib/python3.12/site-packages/cleo/application.py", line 457, in _run_command
File ".../Library/Caches/pypoetry/virtualenvs/poetry-py3.12/lib/python3.12/site-packages/cleo/commands/base_command.py", line 117, in run
File ".../Library/Caches/pypoetry/virtualenvs/poetry-py3.12/lib/python3.12/site-packages/cleo/commands/command.py", line 61, in execute
File ".../poetry/src/poetry/console/commands/env/use.py", line 33, in handle
env = manager.activate(self.argument("python"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../poetry/src/poetry/utils/env/env_manager.py", line 248, in activate
self.create_venv(executable=python_path, force=create)
File ".../poetry/src/poetry/utils/env/env_manager.py", line 596, in create_venv
self.build_venv(
File ".../poetry/src/poetry/utils/env/env_manager.py", line 682, in build_venv
cli_result = virtualenv.cli_run(args, setup_logging=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../Library/Caches/pypoetry/virtualenvs/poetry-py3.12/lib/python3.12/site-packages/virtualenv/run/__init__.py", line 31, in cli_run
File ".../Library/Caches/pypoetry/virtualenvs/poetry-py3.12/lib/python3.12/site-packages/virtualenv/run/__init__.py", line 49, in session_via_cli
File ".../Library/Caches/pypoetry/virtualenvs/poetry-py3.12/lib/python3.12/site-packages/virtualenv/run/__init__.py", line 76, in build_parser
File ".../Library/Caches/pypoetry/virtualenvs/poetry-py3.12/lib/python3.12/site-packages/virtualenv/run/plugin/discovery.py", line 22, in get_discover
StopIteration
And .../Library/Caches/pypoetry/virtualenvs/poetry-py3.12
env has been deleted.
Description
Steps to reproduce:
poetry env use /<path to python 3.12.2>/bin/python
.rm -rf $(poetry env info --path)
.poetry install
(Poetry will use the newest patch version by default 3.12.3).poetry env use /.../pypoetry/virtualenvs/poetry-project-name/bin/python
Poetry deletes the existing poetry environment with an error:
Could not find the python executable /.../pypoetry/virtualenvs/poetry-project-name/bin/python
Workarounds
Manually change the version of the interpreter in the file
env.toml
.In my example from 3.12.2 to 3.12.3.
Poetry Installation Method
system package manager (eg: dnf, apt etc.)
Operating System
MacOS Sonoma 14.3.1
Poetry Version
1.7.1
Poetry Configuration
Python Sysconfig
No response
Example pyproject.toml
Poetry Runtime Logs