python-poetry / poetry

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

(šŸŽ) `env use` should be able to reference one of the outputs from `env list` #4992

Open KotlinIsland opened 2 years ago

KotlinIsland commented 2 years ago

Feature Request

On Windows env use really sucks (at least for my setups)

> poetry env use 3.10
'python3.10' is not recognized as an internal or external command,
operable program or batch file.

  CalledProcessError

[...]

Why can't I just specify one of the existing envs directly by name?

> poetry env list
test-O3eWbxRl-py3.10 (Activated)
test-O3eWbxRl-py3.11
> poetry env use test-O3eWbxRl-py3.11
'test-O3eWbxRl-py3.11' is not recognized as an internal or external command,
operable program or batch file.

  CalledProcessError

[...]

Instead I have to go mess around trying to find the path to the python3.11 interpreter and specify that every time I want to switch envs (I can use system and py though which sometimes helps).

> poetry env use C:\Users\amongus\AppData\Local\Programs\Python\Python311\python.exe

Full py launcher support would be good and probably remove the need for this.

devmcp commented 2 years ago

I'm also having this issue. Did you find any useful fixes/workarounds for it?

KotlinIsland commented 2 years ago

Make shortcuts that mimic python3.10 etc

simmel commented 1 year ago

And referencing the env name e.g. test-O3eWbxRl-py3.10 used to work but not anymore = / Please bring it back!