Skip to content

Change text to "Select at workspace level" instead of "Entire workspace" when selecting or clearing interpreters in a multiroot folder scenario #17037

Closed

Description

@ishalad

I have already selected python interpreter so many times but vscode still showing this warning please help me with this error i m fresher and I really need to solve this issue

Activity

  1. added
    triage-needed
    on Aug 19, 2021
  2. added
    bug
    and removed
    triage-needed
    on Aug 19, 2021
  3. karrtikr commented on Aug 19, 2021

    @karrtikr

    Thanks for the bug report, but unfortunately we need some more information from you in order to triage this issue appropriately. Please edit your opening comment by providing a filled-in copy of our issue template. Once you are done please leave a comment to that effect.

  4. added
    info-needed
    on Aug 19, 2021
  5. added
    area-environments
    and removed
    info-needed
    on Aug 19, 2021
  6. karrtikr commented on Aug 19, 2021

    @karrtikr

    Please provide the logs as mentioned in the issue template.

    Logs

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

    XXX
    

  7. added
    info-needed
    on Aug 19, 2021
  8. software-artisan commented on Sep 15, 2021

    @software-artisan

    I had a similar but slightly different problem..

    Environment data

    VS Code version: 1.60.1
    Extension version (available under the Extensions sidebar): v2021.9.1230869389
    OS and version: Windows 10 (but using remote ssh into ubuntu 18.04)
    Python version (& distribution if applicable, e.g. Anaconda): python 3.8
    Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
    Relevant/affected Python packages and their versions: XXX
    Relevant/affected Python-related VS Code extensions and their versions: XXX
    Value of the python.languageServer setting: pylance
    [NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]

    Expected behaviour

    When a "Python Interpreter" is selected, the setting must be applied.

    Actual behaviour

    When a "Python Interpreter" is selected, the selected interpreter is not applied.

    Steps to reproduce:

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

    1. created a new workspace
    2. added a directory with python code to the workspace
    3. vscode-python extension prompted "No python interpreter is selected. You need to select a python interpreter to enable features such as IntelliSense, linting, and debugging"
      • image
    4. Tried View > Command Palette > Python:Select Interpreter > "Entire Workspace" and chose an interpreter from the list
    5. This selection was not applied.
    6. The python interpreter list in step # 4 showed the current interpreter as ./.env/bin/python. I had never set this interpreter. And I didn't see this interpreter specified in user settings or remote ssh settings or workspace settings or folder settings. Not sure where it was pulling it from
    7. Tried View > Command Palette > Python:Select Interpreter > "some folder" and chose an interpreter from the list
    8. This selection was applied..

    In summary, to select the interpreter, choosing "entire workspace" did not work. Had to choose one of the folders in the workspace during the "Python: select interpreter" command to set the interpreter..

    Logs

    The "current interpreter" (which was not set by me; similar to what is described in # 6 above but a different interpreter) in this run is what is shown below.

    • image

    User belongs to experiment group 'pythonaa'
    User belongs to experiment group 'pythonJediLSP'
    User belongs to experiment group 'pythonDiscoveryModuleWithoutWatcher'
    User belongs to experiment group 'pythonTensorboardExperiment'
    User belongs to experiment group 'pythonSurveyNotificationcf'
    User belongs to experiment group 'PythonPyTorchProfiler'
    User belongs to experiment group 'pythonDeprecatePythonPath'
    User belongs to experiment group 'pythonSortEnvs'
    User belongs to experiment group 'pythonRunFailedTestsButtonDisplayedcf'
    User belongs to experiment group 'pythonRefreshTestsButtonDisplayed'
    User belongs to experiment group 'pythonRememberDebugConfigcf'
    Python interpreter path: ~/miniconda3/envs/detectron2/bin/python
    Starting Pylance language server.
    Error 2021-09-15 23:15:49: Failed to check if file needs to be fixed [EntryNotFound (FileSystemError): Unable to read file 'vscode-remote://ssh-remote+207.180.251.250/home/user/dev/detectron2/.vscode/settings.json' (Error: Unable to resolve non-existing file 'vscode-remote://ssh-remote+207.180.251.250/home/user/dev/detectron2/.vscode/settings.json')
    at _handleError (/home/user/.vscode-server/bin/83bd43bc519d15e50c4272c6cf5c1479df196a4d/out/vs/server/remoteExtensionHostProcess.js:94:160087)
    at async y.readText (/home/user/.vscode-server/extensions/ms-python.python-2021.9.1230869389/out/client/extension.js:9:314351)
    at async p.doesFileNeedToBeFixed (/home/user/.vscode-server/extensions/ms-python.python-2021.9.1230869389/out/client/extension.js:59:823969)
    at async /home/user/.vscode-server/extensions/ms-python.python-2021.9.1230869389/out/client/extension.js:59:823096
    at async Promise.all (index 1)
    at async p.getFilesToBeFixed (/home/user/.vscode-server/extensions/ms-python.python-2021.9.1230869389/out/client/extension.js:59:823042)
    at async p.updateTestSettings (/home/user/.vscode-server/extensions/ms-python.python-2021.9.1230869389/out/client/extension.js:59:822669)] {
    code: 'FileNotFound'
    }
    Python interpreter path: ~/miniconda3/envs/infinstor/bin/python

  9. karrtikr commented on Sep 15, 2021

    @karrtikr

    In summary, to select the interpreter, choosing "entire workspace" did not work. Had to choose one of the folders in the workspace during the "Python: select interpreter" command to set the interpreter..

    This seems to be expected behavior, as Selecting an intepreter at workspace level won't work if you have already set it at a folder level. Workspace folder settings override workspace settings, just like workspace settings override a user setting. Perhaps we could change the wording "Entire workspace" to "Set at workspace level" to make this clearer.

  10. removed
    bug
    info-needed
    on Sep 15, 2021
  11. 14 remaining items

  12. luabud commented on Oct 1, 2021

    @luabud
    Member

    Quynhd07 done! 😊

  13. added 3 commits that reference this issue on Oct 2, 2021
  14. added 2 commits that reference this issue on Oct 13, 2021
  15. karrtikr commented on Oct 25, 2021

    @karrtikr

    Fixed by Quynhd07 🙂

  16. added
    verification-needed
    on Oct 25, 2021
  17. rchiodo commented on Oct 26, 2021

    @rchiodo

    The text has changed, but "Select at workspace level" doesn't actually work? At least I don't see it having any effect.

  18. rchiodo commented on Oct 26, 2021

    @rchiodo

    Added a new issue for the workspace level command:
    #17854

  19. locked as resolved and limited conversation to collaborators on Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-environmentsdebtgood first issueverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions