Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Python version installed in virtual environment #6051

Closed
3 tasks done
cifkao opened this issue Jul 22, 2022 · 2 comments
Closed
3 tasks done

Incorrect Python version installed in virtual environment #6051

cifkao opened this issue Jul 22, 2022 · 2 comments
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@cifkao
Copy link

cifkao commented Jul 22, 2022

  • 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
@cifkao cifkao added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jul 22, 2022
@finswimmer
Copy link
Member

Hey,

lots of improvements have been made in this area in the 1.2 release and should be solved. Maybe it's necessary to
set virtualenvs.prefer-active-python to true in your use case.

fin swimmer

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants