Skip to content

Default to pipenv or poetry environments if available #19153

Closed

Description

Already started a discussion about this here. It's already detected if pipenv is available and labels the correct environment as the pipenv environment, but vscode-python still defaults to / recommends the global interpreter.

interpreter selection

I would like vscode-python to default to the pipenv interpreter if it is available or have an option to alter this behaviour.

Activity

  1. karrtikr commented on May 17, 2022

    @karrtikr

    Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.

  2. karrtikr commented on May 17, 2022

    @karrtikr

    I was working on #18263 which could also solve this issue for you. It basically means only pipenv environment created for the current workspace will be displayed in the list, so we won't have to choose or run any additional commands.

  3. yomajo commented on May 28, 2022

    @yomajo

    Absolutely!

    I experimenting with fastapi, installed via
    pipenv install fastapi

    and import failed. Googled for like 10 minutes to find out, interpreter was still global.

    pipenv install should trigger vscode intepreter change imo.

  4. karrtikr commented on Jun 2, 2022

    @karrtikr

    Similar issue for pyenv: #1167

  5. brettcannon commented on Jul 21, 2022

    @brettcannon
    Member

    While this issue didn't garner enough upvotes, the team thinks it's a reasonable idea, so we will keep this issue open.

  6. rt121212121 commented on Jan 23, 2023

    @rt121212121

    It'd be good to get the documentation changed at least. It suggests that pipenv interpreter should work out of the box, but all my web searchings until I found this issue used fragile workarounds to force it.

    https://code.visualstudio.com/docs/python/environments

    image

    Even a note saying that pipenv requires manually changing the detected interpreter, would be a direct pointer to getting this working. I had to garner that hint from above.

  7. karrtikr commented on Mar 22, 2024

    @karrtikr

    Fix should be out in the pre-release version of the extension, use the following to try it out:

    image

  8. changed the title [-]Default to pipenv environment if available[/-] [+]Default to pipenv or poetry environments if available[/+] on Mar 22, 2024
  9. locked as resolved and limited conversation to collaborators on Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-environmentsFeatures relating to handling interpreter environmentscommunity askFeature request that the community expressed interest infeature-requestRequest for new features or functionalityneeds proposalNeed to make some design decisionson-testplanAdded to test plan

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions