Skip to content

venv environments are not detected until folder is opened #21659

Closed as not planned

Description

Environment data

  • VS Code version: 1.80.1 (User Setup)
  • Jupyter Extension version (available under the Extensions sidebar): v2023.6.1101941928
  • Python Extension version (available under the Extensions sidebar): v2023.12.0
  • OS (Windows | Mac | Linux distro) and version: Windows 10, V10.0.19045 Build 19045
  • Python and/or Anaconda version: 3.11.4
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Jupyter server running: Local

Expected behaviour

Environments in the same folder are detected under select kernels

Actual behaviour

Only the system interpreter is detected

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Create an ipynb file with some code in a folder and initialize a venv in the same.
  2. Try to open that file without opening the folder from your explorer.
Output for Jupyter in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Jupyter)


Activity

  1. DonJayamanne commented on Jul 19, 2023

    @DonJayamanne

    Than you for filling this issues, however the steps area not sufficient to replicate this issue
    Please could you provide steps to repro issue

    • What use the folder structure like
    • Where is the ven in the folder
    • Can you see the env in the python interpreter list
    • What folder do you open in vscode?
  2. aayushkatariaa commented on Jul 19, 2023

    @aayushkatariaa
    Author
    • This is the structure
      image
    • venv is inside the folder? not sure what is expected here
    • No, the environment does not show up in the interpreter list either
    • None, I open the file without opening any folder
  3. karrtikr commented on Jul 19, 2023

    @karrtikr

    Please provide the debug logs which can help diagnose the issue:

    • Run Developer: Set log level command

    • Select Python -> Select Trace

    • Run Developer: Reload Window command

    • Provide the output:

      Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

      XXX
      

  4. aayushkatariaa commented on Jul 20, 2023

    @aayushkatariaa
    Author

    note that the company name has been changed due to privacy reasons along with some other minor edits
    log.txt

  5. karrtikr commented on Jul 21, 2023

    @karrtikr

    Does venv environments show up when using Python: Select Interpreter command?

  6. 3 remaining items

  7. aayushkatariaa commented on Jul 21, 2023

    @aayushkatariaa
    Author

    Also this issue may also be related to #21633 although I'm not a 100% sure on that

  8. karrtikr commented on Jul 21, 2023

    @karrtikr

    Try to open that file without opening the folder from your explorer.

    It seems to be that no workspace folder is opened, is that the case?

  9. aayushkatariaa commented on Jul 21, 2023

    @aayushkatariaa
    Author

    Yeah

  10. karrtikr commented on Jul 21, 2023

    @karrtikr

    You need a workspace folder to be opened for workspace specific environments to be discovered. There is no way for us to know which project to look for environments in otherwise.

  11. karrtikr commented on Jul 21, 2023

    @karrtikr

    Try 'File-> Open folder...' option

  12. karrtikr commented on Jul 21, 2023

    @karrtikr

    Closing as this seems to be the intended behavior.

  13. aayushkatariaa commented on Jul 31, 2023

    @aayushkatariaa
    Author

    Try 'File-> Open folder...' option

    You need a workspace folder to be opened for workspace specific environments to be discovered. There is no way for us to know which project to look for environments in otherwise.

    So is it intended that environments that are present in such folders do not show up?

  14. aayushkatariaa commented on Jul 31, 2023

    @aayushkatariaa
    Author

    Since it kind of limits functionality so i thought it'd at least look in the same folder as the opened file

  15. locked as resolved and limited conversation to collaborators on Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugtriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions