Skip to content

poetry env info does not respect virtualenvs.prefer-active-python = true setting #5947

@nirvana-msu

Description

@nirvana-msu
  • 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).

  • OS version and name: WSL, Ubuntu 20.04

  • Poetry version: 1.2.0b1

Issue

I'm relying on pyenv to specify which base Python version Poetry should be using. It was incredibly confusing, coming from an old version of Poetry, to find out that there's now a virtualenvs.prefer-active-python setting which defaults to false - so has to be set to true to use Poetry with pyenv. While that fixes e.g. poetry install, poetry env info still ignores pyenv even with this setting. To get it to provide information about my actual venv I had to wrap the call with poetry run (for it to pick up pyenv python correctly), i.e. poetry run poetry env info --path.

As a side note, this new prefer-active-python setting defauling to false is such an incredible gotcha. I would think the vast majority of (linux) users would use Poetry alongside pyenv (and everyone was using get-poetry.py installer in the past as it was the recommended one), and this will get them all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triagedstatus/waiting-on-responseWaiting on response from author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions