You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VS Code version: Latest Insider as of now
Python Extension version: Latest version available in Marketplace
Python Version: 3.6
OS and version: Windows 10 build 16299
Actual behavior
In my problems view, I'm seeing errors about "no module named" followed by the path to the current file I'm in, e.g., c:\users\name\project\app\views.py). However, this code runs fine using the same Python context and gives no such errors.
Expected behavior
I shouldn't see these errors since they aren't errors.
Steps to reproduce:
(going to list everything I did, not sure what parts are relevant)
Create a new Django project in the home folder of WSL (Windows Subsystem for Linux).
Realize you can't reach that filesystem from Vs Code and copy the folder to your Windows home folder, e.g. c:\users\name\dev.
Open the project in Visual Studio Code. Note that we're not using a virtual environment. One was created, but in WSL so it would be Linux-based and probably not useful to the Windows host. It is, however, present in the copied folder in my case, although it is not being used. Autopep8, prospector and Django 1.11 are installed to the global context using pip.
Open any given file, settings.py is fine.
At this point, I am already getting this error by Prospector about no module name ....../settings.py.
I tried feeding --uses django into the ProspectorArgs array in settings.json but this didn't fix the issue.
Copied from original issue: DonJayamanne/pythonVSCode#1289
What's the path to your python virtual environment?
Please ensure this is configured in your workspace settings (settings.json), i.e. the setting python.pythonPath needs to point to the python interpreter you are working on.
Python I'm working on is my Windows OS's global python install, which is added to the OS PATH environment variable. Wouldn't the extension pick it up at that point?
For some reason Prospector is passing into Pylint the file's path with the directory structured duplicated, e.g. c:\a\b\c\d.py as c:\a\b\c\a\b\c\d.py.
Output:
I'm seeing a similar issue (on linux). With prospector enabled everything appears to work. However, the first message for each file is similar to the following:
[prospector - pylint] fatal:No module named home/<user>/<pkg>/spam.py
Two things to note:
the path has no leading slash
if I have linting failures in a file then it reports them correctly, even though it also reports the above fatal error
I'm not seeing any duplication in the reported path.
Activity
DonJayamanne commentedon Nov 14, 2017
Unfortulately WSL isn't supported at this stage.
https://github.com/DonJayamanne/pythonVSCode/issues/534
DonJayamanne commentedon Nov 14, 2017
Hopefully this will be resolved soon. Please follow the #534 for updates.
DonJayamanne commentedon Nov 14, 2017
From Florian Beijers (@zersiax) on October 10, 2017 10:9
Don Jayamanne (@DonJayamanne) From step 2 in my reproduce steps, WSL is completely out of the picture, so I don't think this is a WSL issue?
DonJayamanne commentedon Nov 14, 2017
What's the path to your python virtual environment?
Please ensure this is configured in your workspace settings (settings.json), i.e. the setting
python.pythonPathneeds to point to the python interpreter you are working on.DonJayamanne commentedon Nov 14, 2017
From Florian Beijers (@zersiax) on October 10, 2017 18:29
Python I'm working on is my Windows OS's global python install, which is added to the OS PATH environment variable. Wouldn't the extension pick it up at that point?
DonJayamanne commentedon Nov 14, 2017
Yes it would.
[-]Extension with Prospector linting gives false positives[/-][+]Prospector gets file paths wrong[/+]brettcannon commentedon Jan 11, 2018
For some reason Prospector is passing into Pylint the file's path with the directory structured duplicated, e.g.
c:\a\b\c\d.pyasc:\a\b\c\a\b\c\d.py.Output:
ericsnowcurrently commentedon Mar 7, 2018
I'm seeing a similar issue (on linux). With prospector enabled everything appears to work. However, the first message for each file is similar to the following:
Two things to note:
I'm not seeing any duplication in the reported path.
Ensures file paths are properly encoded when passing them as argument…