-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
.pth files seem to be ignored in the venv site-packages directory #1520
Comments
See also microsoft/pylance-release#78 microsoft/pylance-release#78 (comment) Editable installs / pth files work, so long as the they add is outside the workspace. |
More importantly, refer to #1473 |
Ah, yes, they appear to be using the venv setting, which does not use python calls to get search paths. I bet it'd work via normal interpreter paths. |
Thanks for the quick responses and the pointers! You are right, I was using a venv (outside of the workspace). After removing it and hacking Unfortunately, I don't think I can use the same workaround as in #1473 (select the interpreter "globally") because I have to use different venvs for different execution environments. |
I've added support for ".pth" files, so this will work in the next release. |
This is addressed in Pyright 1.1.114, which I just published. It will also be in the next release of Pylance. |
Awesome, thank you! |
Sorry for not trying it out earlier, but I still have the same issue with Pyright 1.1.117 (using a venv pointing outside the workspace). Was that use case supposed to be fixed by the changes in version 1.1.14? |
If you think that the ".pth" file support isn't working in your case, please file a new bug with logs. |
Describe the bug
.pth files seem to be ignored in the venv site-packages directory
To Reproduce
In
<venv>/lib/pythonX.Y/site-packages
, run the following commands:Then simply use
import bar
in a python file and runpyright
Expected behavior
No error
Screenshots or Code
VS Code extension or command-line
Additional context
My undersanding from https://docs.python.org/3/library/site.html is that the .pth file should be processed.
The text was updated successfully, but these errors were encountered: