WSL2 can't install/find linter
See original GitHub issueEnvironment data
- VS Code version: 1.43
- Extension version (available under the Extensions sidebar): 2020.2.64397
- OS and version: Win10 2004
- Python version (& distribution if applicable, e.g. Anaconda): 3.7.4
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
- Relevant/affected Python packages and their versions: XXX
- Relevant/affected Python-related VS Code extensions and their versions: XXX
- Jedi or Language Server? (i.e. what is
"python.jediEnabled"
set to; more info #3977): Jedi Disabled - Value of the
python.languageServer
setting: Microsoft
Expected behaviour
Linter gets installed
Actual behaviour
Fails to install linter
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
- Open Python project in WSL
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
Interpreter does not exist; analysis will not be available.
There is no Pip installer available in the selected environment.
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging
)
Downloading https://pvsc.azureedge.net/python-language-server-stable/Python-Language-Server-linux-x64.0.5.31.nupkg...
Language server download complete
Unpacking archive... done
[Info - 5:21:35 PM] Analysis cache path: /home/stan/.cache/Microsoft/Python Language Server
[Info - 5:21:35 PM] Microsoft Python Language Server version 0.5.31.0
[Info - 5:21:35 PM] Workspace root: /home/stan/projects/work/LuaAPIDocumentation
[Info - 5:21:36 PM] Interpreter search paths:
[Info - 5:21:36 PM] User search paths:
[Error - 5:21:36 PM] Unable continue, no builtins module content.
[Error - 5:21:36 PM] Request textDocument/documentSymbol failed.
Message: Object reference not set to an instance of an object.
Code: -32000
at Microsoft.Python.LanguageServer.Implementation.Server.HierarchicalDocumentSymbol(DocumentSymbolParams params, CancellationToken cancellationToken) in E:\A\_work\3\s\src\LanguageServer\Impl\Implementation\Server.Symbols.cs:line 37
at Microsoft.Python.LanguageServer.Implementation.LanguageServer.DocumentSymbol(JToken token, CancellationToken cancellationToken) in E:\A\_work\3\s\src\LanguageServer\Impl\LanguageServer.cs:line 226
[Error - 5:24:24 PM] Unable to find document file:///home/stan/projects/work/LuaAPIDocumentation/api_gen/dependencies.py
[Error - 5:25:41 PM] Unable to find document file:///home/stan/projects/work/LuaAPIDocumentation/api_gen/dependencies.py
pip is aliased to pip3 and works fine in the terminal
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Can't install hadolint on Ubuntu with WSL 2 - Stack Overflow
If you want to use the local binary, all you need to do is to grant it the execution permission: chmod +x /bin/hadolint....
Read more >Set up Node.js on WSL 2 - Windows - Microsoft Learn
A guide to help you get your Node.js development environment set up on Windows Subsystem for Linux (WSL).
Read more >Work in Windows Subsystem for Linux with Visual Studio Code
Linters are used to show errors and warnings in source code. Go ahead and select Install. pylint not installed notification. Now, when you...
Read more >Windows11 with WSL2: finally a Unix/Mac friendly ... - seeliang
... improvement with evergreen linter rules setup. When it hits grep (Unix command), the developers with window setup got an error and we...
Read more >Golangci-lint on windows with WSL
I was configuring my go linter on a project within WSL2, and I installed the `golangci-lint` program inside my WSL2 distro since it's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The new setting is now available with the latest version of the extension as a experiment. Add this to your user settings, you will have to enable this in WSL and also in the host, for it to work well between the two.
After this, you will have to select the interpreter once, per workspace. The extension will remember the setting on that machine from then on. There is also a setting to provide a global default interpreter that we will use in case no interpreter is selected. you can set that using
@Stanzilla we are doing work to change how we handle the path to interpreter entirely. We will definitely consider this scenario when addressing that.