-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pylance unable to correctly resolve local python packages installed in WSL Ubuntu in vscode WSL remote mode. #1046
Comments
I've attempted to uninstall and reinstall pylance and my virtual environment setup a couple times and on another machine, and every time I get a broken setup, but the brokenness varies. Sometimes pylance becomes correctly aware that it should be Let me know if there are any other tests or info you may need. |
Thanks for the report. Will investigate this. Have two questions:
Thanks! |
1.) I've attempted the installation with both editable installs and non-editable installs. Both of which result in funky behavior. 2.) I can create a repository later tonight and link it. |
Our normal solution is to recommend setting an extraPath to explicitly list your import roots (we have no idea that you need to import relative to a subfolder of the workspace without configuration); the editable install would have made that unnecessary so that's confusing (hence wanting a repro). Doesn't have to be as automated as a script, so long as it's clear what to do. |
Here is the example repository. The issue can be repeated with both |
Your example seems to work fine for me on MacOS. I replaced the contents of from pylancemodule.submodule import test_function
test_function() After doing the editable install in your shell script, I'm able to run I confirmed that there's a symbolic link called Does this match what you're seeing? I'm wondering if the problem is specific to Linux (or your specific version of Ubuntu). |
Yes it does work correctly on MacOS, as I generally develop on MacOS. It seems to be only a WSL Remote mode problem. I haven't tried Ubuntu recently, but I'd be willing wager it probably works fine on Ubuntu as well, but maybe it's possible it can be recreated in Ubuntu outright. |
I have this same problem on my win10 setup, with WSL2-Ubuntu. Willing to help out if needed. |
I have the same issue, still no fix :C |
The next release fixes the import completions to not offer up items that won't resolve when accepted. |
This issue has been fixed in version 2021.7.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202190-1-september-2021 |
Environment data
More environment information
Expected behaviour
Given this package structure and contents.
__init__.py
is emptytest.py
is emptytrash.py
contents belowMy setup.py contents
pylance should recognize the packages namespace correctly and suggest/be aware of the packages contents.
should invoke pylance suggestions and hints.
Actual behaviour
If I attempt to import the package pylance is unable to correctly resolve the packages namespace and suggests the incorrect namespace.
If I use the correct namespace of the package, my script will run successfully but pylance is unable to resolve it.
Logs
Python Language Server Log
The text was updated successfully, but these errors were encountered: