Skip to content

Incorrect Python version installed in virtual environment #6051

@cifkao

Description

@cifkao
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

I have a project that requires Python ^3.9. The system installation in /usr/bin/python3 is Python 3.6 and I'm in a Conda environment with Python 3.9.7.

Running poetry install gives:

The currently activated Python version 3.6.8 is not supported by the project (^3.9).
Trying to find and use a compatible version. 
Using python3 (3.9.7)
Creating virtualenv poetry-test-PDOMCCYP-py3.9 in /home/ocifka/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies... (0.1s)

Writing lock file

However, this is the opposite of what happens.

Firstly, the activated Python was version 3.9.7 (from Conda) and not 3.6.8:

$ python --version
Python 3.9.7

Secondly, Poetry goes ahead and installs Python 3.6.8:

$ ~/.cache/pypoetry/virtualenvs/poetry-test-PDOMCCYP-py3.9/bin/python --version
Python 3.6.8

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