Skip to content

poetry env info has wrong virtualenv info #6893

@adammarples

Description

@adammarples
  • 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.

Issue

Creating a fresh poetry environment, the info returned by poetry env info does not match the virtualenv created

  1. create a fresh dir
mkdir sample && cd sample
  1. check that my active python is as I want (3.10.3 installed using asdf)
> ~/sample $ python --version
Python 3.10.3
> ~/sample $ which python
/Users/adammarples/.asdf/installs/python/3.10.3/bin/python

2.5 make sure prefer-active-python is set to true

> ~/sample $ poetry config virtualenvs.prefer-active-python true
  1. poetry init, and manually changed suggested python compatible version from 3.9 to 3.10
> ~/sample $ poetry init
Compatible Python versions [^3.9]:  ^3.10
  1. poetry env info, no path so far, but declares that the Virtualenv is Python version 3.9.11
> ~/sample $ poetry env info
Virtualenv
Python:         3.9.11
Implementation: CPython
Path:           NA
Executable:     NA


System
Platform:   darwin
OS:         posix
Python:     3.9.11
Path:       /Users/adammarples/.pyenv/versions/3.9.11
Executable: /Users/adammarples/.pyenv/versions/3.9.11/bin/python3.9
  1. poetry update seems to create the correct virtualenv (3.10)
> ~/sample $ poetry update
Creating virtualenv sample-vPyTu8GS-py3.10 in /Users/xxxx/Library/Caches/pypoetry/virtualenvs
> ~/sample $ poetry run python --version
Python 3.10.3
> ~/sample $  poetry run which python
/Users/adammarples/Library/Caches/pypoetry/virtualenvs/sample-vPyTu8GS-py3.10/bin/python
  1. poetry env info, still no path, but declares that the Virtualenv is Python version 3.9.11
> ~/sample $ poetry env info
Virtualenv
Python:         3.9.11
Implementation: CPython
Path:           NA
Executable:     NA


System
Platform:   darwin
OS:         posix
Python:     3.9.11
Path:       /Users/adammarples/.pyenv/versions/3.9.11
Executable: /Users/adammarples/.pyenv/versions/3.9.11/bin/python3.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/venvRelated to virtualenv managementkind/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