[Python] How can I make poetry install the Python version required in pyproject.toml?

Discussão em 'Python' iniciado por Stack, Julho 11, 2025.

  1. Stack

    Stack Membro Participativo

    One thing about poetry seems really odd to me:

    When you install poetry, it installs the latest Python version and uses this as a default for all poetry projects. If a different Python version is required as per a per the project's pyproject.toml, the poetry documentation states that you must point poetry to a suitable Python executable via poetry env use.

    But that means that you need to already have said Python version installed manually.

    Isn't the whole point of a dependency manager to install all the right dependency versions for you inside the virtual environment, including the required Python version?

    Is there a way to get poetry to install the right Python version automatically or do I have to manually manage the various Python versions that all my poetry projects require?

    Continue reading...

Compartilhe esta Página