Open b-long opened 6 months ago
I've hit possibly the same issue. With the same result, the "[Errno 2] No such file or directory: 'python'"
tl; dr: I need to unset VIRTUAL_ENV
In my case it was due to bad interaction with VS code:
poetry env use python3.10
peotry env remove my-package-ABC-py3.10
poetry env list
and poetry env use python3.10
Fix:
The difference between broken state and working state is that when VS code detect the virtualenv, VS code "enable" it (but not as usual: PS1 isn't changed, deactivate
function doesn't exist). Especially environment variable VIRTUAL_ENV is set, which poetry use. But since this point to the deleted virtualenv, python
does not exist in that non-existing virtualenv.
Description
I'm a long-time Poetry-enthusiast โค๏ธ Amazing project and kudos to the whole team, thanks for all you do! ๐ ๐ฎ ๐ฐ
Since I have a workaround, I'm not terribly worried about this issue. That said, if it helps someone else I'm happy to provide a workaround & some information.
My workflow is basically:
Also, note that I have multiple versions of Python installed:
Workarounds
The workaround, which solves this issue for me is exactly as yene stated here: https://github.com/python-poetry/poetry/issues/6841#issuecomment-1978245754
Poetry Installation Method
pipx
Operating System
macOS 14.4
Poetry Version
Poetry (version 1.8.2)
Poetry Configuration
Python Sysconfig
Example pyproject.toml
Poetry Runtime Logs
With
-vvv
: