question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

command python.xxx not found in workspaces without folders

See original GitHub issue

Environment data

  • VS Code version: 1.28.1-1539281690
  • Extension version (available under the Extensions sidebar): 2018.9.0
  • OS and version: Linux Mint 19 x64
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
  • Relevant/affected Python packages and their versions: N/A

Actual behavior

When working in a workspace that has no associated folder, nearly all python.xxx commands fail with a “not found” error. The only exception seems to be python.setInterpreter, which works fine.

When the window is not part of a workspace or when adding a folder to the workspace, the extension instantly resumes full functionality.

Expected behavior

The extension used to work fine with workspaces that have no associated folders.

Steps to reproduce:

  1. Install the extension, if necessary
  2. File > New Window
  3. File > Save Workspace As
  4. View > Command Palette, try to run any Python command other than Select Interpreter and see it fail
  5. File > Add Folder to Workspace
  6. Try step 3 again and see it succeed

Logs

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

n/a

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

Error: command 'python.setLinter' not found
    at t._tryExecuteCommand (/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:3030)
    at /usr/share/code/resources/app/out/vs/workbench/workbench.main.js:3029
    at n.Class.derive._oncancel.then (/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:167)
    at t.executeCommand (/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:3029)
    at t.run (/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:1366)
    at t.run (/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:1367)
    at /usr/share/code/resources/app/out/vs/workbench/workbench.main.js:3015

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
gm10commented, Sep 12, 2019

Didn’t realize this one was still open, I believe this was fixed a while ago actually.

1reaction
gm10commented, Oct 23, 2018

Ah good. In that case I added a PR that fixes it on my end @DonJayamanne . Disclaimer: I know nothing about your code base, additional changes may be required elsewhere.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named XXX - Stack Overflow
According to me you are getting directory related issues. Try placing the necessary files in a same directory.
Read more >
Installation troubleshooting — ROS 2 Documentation: Humble ...
Sometimes rclpy fails to be imported because the expected C extension libraries are not found. If so, compare the libraries present in the...
Read more >
cargo-make | Rust task runner and build tool.
Overview. The cargo-make task runner enables to define and configure sets of tasks and run them as a flow. A task is a...
Read more >
I'm getting storage errors when running flows from ...
I'm getting storage errors when running flows from deployments using DockerFlowRunner (FileNotFoundError: [Errno 2] No such file or directory: ' ...
Read more >
Developing Python Web Applications with Flask
There are many Python frameworks available, e.g., full-stack frameworks like Djiango, ... x.x.x/pysrc ... Also there is no need to use the export...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found