python-poetry / python-poetry/poetry

(🎁) `env use` should be able to reference one of the outputs from `env list`

Open
#4,992 3 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature status/triage
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Windows poetry env list and poetry env use commands shown in the issue, then trace the CLI entry points that handle them. Done means env use can select an environment name returned by env list, with behavior covered for the Windows case described.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.