-
Notifications
You must be signed in to change notification settings - Fork 768
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 does not update on adding new files and packages #1443
Comments
Any further update on this? Anyone else facing this same issue? |
Is your environment located within your workspace, or outside? If your issue is explicitly that you're installing packages to an environment outside of your workspace, then that's #923, but anything within the workspace (including adding your own code) should work as expected, which is why we didn't close it as a dupe. It wasn't really clear from your issue which you were referring to. |
Yes I am in the workspace when installing package in the environment. Vscode terminal automatically switches to the virtual env when opening a terminal. |
That's not exactly what I mean; where is the environment itself? Did you do Logs would be very helpful here. (Our template normally asks for this, but is mirrored here https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md#filing-an-issue) |
Yes I did exactly that This the PowerShell window in vscode
Here is the pylance error
Here is the python language server output in the text file |
Based on your logs, you don't have that new environment selected; you have your global interpreter selected. At the bottom left, can you change the interpreter and select the one within your workspace? |
Thanks that solved the issue in windows. The Bash Terminal output
Pylance error
The python language server log file is attached here |
the log from WSL2 don't show your .venv in the search path. so I think you are not selecting right interpreter or there is a bug where somehow it doesn't work for you (selecting interpreter). can you try a few times to see whether it ever works? (trying to figure out where the issue is) |
After some testing this appears VSCode doesn't send us file events when using WSL with a workspace shared in windows) ie. /mnt/... If you move your code to a WSL folder like home/ then it should work. known issue apparently. if moving the folder doesn't work feel free to reopen. |
@bschnurr Is there some method for manual refresh of pylance? Moving directories for established projects isn't always as easy as it sounds. |
|
also in my case |
Environment data
Expected behaviour
Pylance should update whenever I install a package or add a file in the directory. and provide autocompletion and checking
Actual behaviour
Whenever I install a package or add, change the name of a file in the project directory pylance does not update. It show import error and autocompletion and intellisense does not work. I have to reload the entire windows for pylance to recognise the file or package
Code Snippet / Additional information
just after installing xknx using:
sudo pip3 install xknx
pylance shows error and does not gives intellisence or autocomplete
I have to restart vscode to get it to work
The text was updated successfully, but these errors were encountered: