Skip to content

Poetry doesn't find a compatible version of python, even though one is available #7772

@tungol

Description

@tungol
  • Poetry version: Introduced in poetry 1.4.0
  • Python version: Python 3.7, 3.10, 3.11 are all involved
  • OS version and name: MacOS and Debian
  • pyproject.toml:
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Running with -vvv did not produce additional output.

Issue

In my project, I have the python dependency python = "~=3.10". I happen to have python 3.11 available on my development laptop, so I use that there. As part of our build pipeline, the pyproject.toml and poetry.lock files are copied into a Debian docker image which has a default python of 3.7, and has 3.10 but not 3.11 available. Prior to Poetry 1.4.0 this worked fine - Poetry would note that 3.7 wasn't supported by the project and then discover and use 3.10 automatically:

#24 0.801 The currently activated Python version 3.7.4 is not supported by the project (~=3.10).
#24 0.801 Trying to find and use a compatible version. 
#24 0.833 Using python3.10 (3.10.8)

On Poetry 1.4.0 and higher, that doesn't happen. Instead, I get an error because 3.11 isn't available:

#23 0.844 The currently activated Python version 3.7.4 is not supported by the project (~=3.10).
#23 0.844 Trying to find and use a compatible version. 
#23 0.885 
#23 0.885 [Errno 2] No such file or directory: 'python3.11': 'python3.11'

I believe this behavior was introduced by #7221 , although I haven't read through the associated MR in detail yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions