[Python] Current Python version (3.9.7) is not allowed by the project (^3.11)

Discussão em 'Python' iniciado por Stack, Fevereiro 8, 2025.

  1. Stack

    Stack Membro Participativo

    We have a poetry project with a pyproject.toml file like this:

    [tool.poetry]
    name = "daisy"
    version = "0.0.2"
    description = ""
    authors = [""]

    [tool.poetry.dependencies]
    python = "^3.9"
    pandas = "^1.5.2"
    DateTime = "^4.9"
    names = "^0.3.0"
    uuid = "^1.30"
    pyyaml = "^6.0"
    psycopg2-binary = "^2.9.5"
    sqlalchemy = "^2.0.1"
    pytest = "^7.2.0"

    [tool.poetry.dev-dependencies]
    jupyterlab = "^3.5.2"
    line_profiler = "^4.0.2"
    matplotlib = "^3.6.2"
    seaborn = "^0.12.1"

    [build-system]
    requires = ["poetry-core>=1.0.0"]
    build-backend = "poetry.core.masonry.api"


    When I change the file to use Python 3.11 and run poetry update we get the following error:

    Current Python version (3.9.7) is not allowed by the project (^3.11).
    Please change python executable via the "env use" command.


    I only have one env:

    > poetry env list
    daisy-Z0c0FuMJ-py3.9 (Activated)


    Strangely this issue does not occur on my Macbook, only on our Linux machine.

    Continue reading...

Compartilhe esta Página