Skip to content
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

Always require restart when installing new package and cannot find python interpreter... further update#2501 #2505

Closed
Zaeem20 opened this issue Mar 23, 2022 · 22 comments
Assignees
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@Zaeem20
Copy link

Zaeem20 commented Mar 23, 2022

I am reopening issue #2501

• i am not using conda & virtual env
• i am at root folder which is D:\MyFolder

Below are the issues require restart to be fixed...
• it occurs when i open vscode first
• give me warning whenever i install new pkg through integrated ps, but it work fine when i run it

@judej
Copy link
Contributor

judej commented Mar 24, 2022

Would you please add the information in the report as described in the troubleshooting guide?

@judej judej added the waiting for user response Requires more information from user label Mar 24, 2022
@heejaechang
Copy link
Contributor

heejaechang commented Mar 24, 2022

meanwhile, you can use "Python: Restart Language Server" command to manually ask server to scan packages. it is the same command we internally call when we discover library changes by file watcher. so, there should be no difference on perf except you are doing it explicitly (instead of us doing it automatically)

@Zaeem20
Copy link
Author

Zaeem20 commented Mar 28, 2022

how do i do that @heejaechang

@Zaeem20
Copy link
Author

Zaeem20 commented Mar 28, 2022

means without doing it manually how do i automate this

@heejaechang
Copy link
Contributor

@Zaeem20 we only support auto restart when packages are installed under project root.
ex) ... project_root/.venv/lib/site-packages/...

we don't support packages installed outside of project root for auto refresh for now.

but that being said, even for the supported case, our restart timeout is 10 mins. which means you won't see the changes for at least 10 mins since the last library changes (such as installing new package)

if 10 mins are too long, only option you have is forcing update using the command ("Python: Restart Language Server" ) above. you can find the command from the command palette (https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette)

@Zaeem20
Copy link
Author

Zaeem20 commented Mar 30, 2022

means i have to wait 10 mins

@RobertCraigie
Copy link

Seems like this is related to #2473.

Adding an option to either reduce or turn off this delay would be a great solution for me.

@heejaechang
Copy link
Contributor

@RobertCraigie we could consider changing static 10 min to something like exponential back off time (10 seconds -> 20 seconds -> 40 seconds -> 10 mins) but until we can come up with better way to handle multi workspaces or some tools that keep writing and deleting temp file in lib path, we probably will leave it to 10 min and ask to use restart command as workaround for now.

@heejaechang
Copy link
Contributor

in next release, we will support detecting outside of workspace root site-package (python search path) changes. but delay will be still 10 mins.

@heejaechang heejaechang added fixed in next version (main) A fix has been implemented and will appear in an upcoming version and removed waiting for user response Requires more information from user labels Mar 31, 2022
@Zaeem20
Copy link
Author

Zaeem20 commented Mar 31, 2022

ok thanks for your co-operation @heejaechang

@Zaeem20 Zaeem20 closed this as completed Mar 31, 2022
@heejaechang heejaechang added bug Something isn't working and removed fixed in next version (main) A fix has been implemented and will appear in an upcoming version labels Mar 31, 2022
@heejaechang heejaechang reopened this Mar 31, 2022
@heejaechang
Copy link
Contributor

unfortunately, I found issue on the fix. we need to move to newer version of LSP for the fix to work. re-activated the issue and I will hold onto it until we move to newer version of LSP.

@Zaeem20
Copy link
Author

Zaeem20 commented Apr 17, 2022

@heejaechang still doing same thing sir
but packages were detecting instantly in virtualenv when i install them via pip, not in out of virtual env
and still i need to restart vs code coz it not detect python interpreter first

@Zaeem20
Copy link
Author

Zaeem20 commented Apr 25, 2022

@heejaechang i am still getting error of no python interpreter is selected, it is not fixed yet
shall i send settings.json screen shot

@bschnurr
Copy link
Member

@heejaechang
Copy link
Contributor

outside workspace fix is now in prerelease build.

@heejaechang
Copy link
Contributor

outside workspace fix should be fixed in next release.

@heejaechang heejaechang added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label May 2, 2022
@debonte
Copy link
Contributor

debonte commented May 5, 2022

@Zaeem20, the fix is available in the latest Pylance insiders build (2022.5.0-pre.1). We're not shipping a stable build this week. If you're not using Pylance insiders, you'll see the fix in next week's stable build.

@Zaeem20
Copy link
Author

Zaeem20 commented May 8, 2022

@debonte its won't fixed yet it showing me reportMissingImports while installing new library from pip
im am using it inside of workspace without virtual env

@heejaechang
Copy link
Contributor

@Zaeem20 only detection is fixed, the 10 min delay is same as before (#2505 (comment))

we will take a look at 10 min delay once we address issues on multi workspace support.

@Zaeem20
Copy link
Author

Zaeem20 commented May 10, 2022

ok i understand, but it was instantly detecting all packages in virtualenv
when i install any package with pip,
is that another issue

@heejaechang

@heejaechang
Copy link
Contributor

@Zaeem20 if there is an issue you want us to take a look? can you open a new issue? using 1 issue for everything make it really hard to track progress.

and when you open an issue, please put logs as described in the troubleshooting guide?

also, providing some repro steps will make it easier for us to track down the issue.

@bschnurr
Copy link
Member

This issue has been fixed in version 2022.5.1, which we've just released. You can find the changelog here: CHANGELOG.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

6 participants