-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
While creating virtual environment Python extension does not prompt with venv notification #16613
Comments
Hi @Debkmr - Just to confirm, you're not seeing a VS Code notification that a virtual environment has been created? The one that should offer to let you set it as the default for the workspace? |
Yes, you got it right there, can you tell me how could I fix that. I am using python 3.9 version.
From: Joshua Partlow <notifications@github.com>
Sent: 03 November 2020 22:51
To: microsoft/vscode-docs <vscode-docs@noreply.github.com>
Cc: Debasish Karmakar <DKarmakar@LaunchCG.com>; Mention <mention@noreply.github.com>
Subject: [External Email] Re: [microsoft/vscode-docs] While creating virtual environment VS Code does not prompt with venv notification (#4101)
Hi @Debkmr<https://github.com/Debkmr> - Just to confirm, you're not seeing a VS Code notification that a virtual environment has been created? The one that should offer to let you set it as the default for the workspace?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://github.com/microsoft/vscode-docs/issues/4101#issuecomment-721267304>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ARTTF344AJU4MLWNDGP7MPTSOA3X5ANCNFSM4TILDTKQ>.
|
I faced this issue earlier when vscode was running too many processes at the same time, so the notification comes a little late |
I am not sure, I am still looking for a work around. |
Is your vscode the latest version? |
Yes, latest VS code and python 3.9
From: Aryan Kapoor <notifications@github.com>
Sent: 05 November 2020 10:04
To: microsoft/vscode-docs <vscode-docs@noreply.github.com>
Cc: Debasish Karmakar <DKarmakar@LaunchCG.com>; Mention <mention@noreply.github.com>
Subject: [External Email] Re: [microsoft/vscode-docs] While creating virtual environment VS Code does not prompt with venv notification (#4101)
Is your vscode the latest version?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://github.com/microsoft/vscode-docs/issues/4101#issuecomment-722135213>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ARTTF3Z2G7HM5SAXZPFOD4LSOITKVANCNFSM4TILDTKQ>.
|
One more question, are you able to activate the environment from the VS Code prompt? I notice in your image that it failed, but it also looks like the environment name wasn't right in that attempt venv vs .venv. Thanks! |
I tried with .venv and venv as well.
From: Joshua Partlow <notifications@github.com>
Sent: 05 November 2020 11:47
To: microsoft/vscode-docs <vscode-docs@noreply.github.com>
Cc: Debasish Karmakar <DKarmakar@LaunchCG.com>; Mention <mention@noreply.github.com>
Subject: [External Email] Re: [microsoft/vscode-docs] While creating virtual environment VS Code does not prompt with venv notification (#4101)
One more question, are you able to activate the environment from the VS Code prompt? I notice in your image that it failed, but it also looks like the environment name wasn't right in that attempt venv vs .venv. Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://github.com/microsoft/vscode-docs/issues/4101#issuecomment-722167433>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ARTTF3YMTMTQCMXK6OFAEKLSOI7OFANCNFSM4TILDTKQ>.
|
Small thing to check, but when you run activate, are you definitely running activate.ps1 (vs activate.bat). Can you try running with the full extension |
Hi @Debkmr - That's an expected issue when running a PowerShell script as execution is restricted by default. You can read about the issue and some solutions here. Essentially, I believe you can either change the execution policy for the process (as discussed in the VS Code Python tutorial here) or there's also a Windows setting you can change to allow the running of local unsigned PowerShell scripts (start -> search developer settings -> PowerShell) in general. Alternatively, you could use CMD as your integrated terminal with the .bat file instead of PowerShell. Does that help? |
If this is still an ongoing issue, please reopen. |
I have this exact issue at the moment. I can activate the viritual enviroment once it is created, but in order to set it as the default one for my workpace I have to manualy add it to the "settings.json" file. It takes a cuple of minutes from the moment it is created to when it shows up in the list over interpreters, and the prompt for adding it to the workspace never shows up. |
@luabud for visibility |
I was able to reproduce this, so I'm transferring it to the Python extension repo. |
hello, any updates? I am also facing this issue |
@karthiknadig I know I can select the interpreter manually. That's what me and everyone else is doing now. I want to know why automatic detection of virtual environment was working before, and now it doesn't. Why you MS developers touch something that works perfectly? |
@karthiknadig |
@omidshojaee We had to build a new system because the old one was literally preventing users from running python extension some scenarios (especially in cases where people used shared resources). File system watching is also expensive, and can slow down processing. So the new discovery system only uses resources as needed. Our intent is to get the same experience was the old one but reduce the consumption of system resources as we do it. @karrtikr Do we need verbose logging or just info logs to get the details on this issue? |
Verbose and info logging are the same right now. @omidshojaee Please set the user setting LogsOutput for
|
@omidshojaee Can you try the following VSIX and see if it works: https://github.com/microsoft/vscode-python/suites/3679707781/artifacts/89611045 Use |
@karrtikr It didn't work. The log is here: |
It seems the extension is not activated. You need to open a python file to activate the extension first and then send the content of Python output channel. |
This comment has been minimized.
This comment has been minimized.
It always activated only after opening a python file, or if we detect you're likely on a python project. Once you activate the extension, please try the steps I provided and leave a comment to that effect. |
The extension always activated after opening a python file. The bug reported here is not about that. It's about detecting the python interpreter after creating the virtual environment. |
We realize that. We're asking you to activate the extension by opening a python file and try creating a virtual environment. If the prompt doesn't show up, send the logs asked earlier to help diagnose the issue. |
This comment has been minimized.
This comment has been minimized.
Python extension cannot detect any python environment if it is not activated. It never was capable of that. If extension was always activated for you then there are these possibilities:
This requirement to have a python file open to activate has existed in a long time (since extension was created). So, if the extension is not activated it won't detect environments being created. If previous version of the extension was activating for you in an empty folder (not because of other extension that depend on it), then that is a bug that should be filed on VS Code. |
This comment has been minimized.
This comment has been minimized.
There, fixed the title for you.
VSCode was never responsible for the prompt. It's the Python extension in VSCode which showed the prompt. Your Python extension is not enabled, hence you don't see the prompt, simple. |
That prompt comes from python extension, we show it when we detect a new environment. vscode-python/src/client/interpreter/virtualEnvs/virtualEnvPrompt.ts Lines 92 to 94 in 5033f1d
Python extension detects or can detect environments only after activation. we cant detect virtual environments created when extension is not activated. You are not providing us the right information to help you here. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The extension cannot detect virtual environment (or show prompts) if it is not activated. At this point the conversation has unfortunately gone off track and this is not helping us resolve the issue (which we are actively working to resolve). |
Fixed in the stable release, feel free to open new issues if that isn't the case. |
While creating virtual environment VS Code does not prompt with venv notification
The text was updated successfully, but these errors were encountered: