-
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
'conda activate base' error with default, exclusive Anaconda install #13464
Comments
@arencambre Are you able to call We are working on improving |
When I run I compared the path on both (output of
Yes, that's what I expected, and that's what I anticipated when opening this issue. I hope this extension can be improved to either do those steps for the user or provide instructions on what needs to be done. conda/conda#8428 doesn't seem to relate. In that case, |
@arencambre The reason Anaconda Powershell Prompt works is because it starts powershell like this:
The way you do it from a regular powershell is using For now, use Note: we do have plans on improving this experience. But that is big change and we are working with Created a doc bug for this: microsoft/vscode-docs#3951 |
@karthiknadig small nitpick: no Don't mean to get lost on this detail. The more important thing is VSCode + Anaconda either should work out of the box, or instructions should be provided to users to help them configure correctly. Running into this again as I am trying to get it working on a clean environment. |
I also observe that I think workarounds may be to disable the policy that blocks script-running or to sign profile.ps1. |
Coming back to this. It appears that to make Anaconda-installed Python work VSCode, one must first run these two commands in an Anaconda PowerShell window:
|
Even though I have path set to conda binary and enabled auto activation, it activates Can someone please confirm that this behavior will be resolved by #5344 (comment), #8864 and that auto activating current environment will be as simple as:
|
@joe733 Yes it will be addressed by #5344. Our plan is to not activate by sending source command to the terminal or even sending any command to the terminal at all. Instead we plan on having the terminal activated as it is created so we don't accidentally have command overlap (with activation commands and some other command) when sending text commands to the terminal. |
Running into this again on a fresh install. This Github issue saves the day each time! |
#2559 reflects the problem with the script execution policy, where in #13464 (comment) I had to change it. |
(bad finding deleted) |
Should be fixed with #2559 (comment). |
Environment data
python.languageServer
setting: Jedi[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (
python.languageServer: 'Microsoft'
), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]Expected behavior
When you execute your first command in a .py file using shift-enter, and that is a valid command, there are no errors in the terminal.
If there is additional setup needed beyond a default install of Visual Studio Code, Anaconda, and the Python extension, then either of these should happen:
IMPORTANT: This is not a support request! Visual Studio Code should just work with a default installation. If it doesn't work, then either the code needs to be improved or a useful notice needs to be given to the user.
Actual behavior
The first command that you execute causes the Python environment to start up. It starts with
conda activate base
, which causes an error:Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - enabled'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'AA_testing - control'
User belongs to experiment group 'LocalZMQKernel - control'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'RunByLine - control'
User belongs to experiment group 'CustomEditorSupport - control'
User belongs to experiment group 'pythonaacf'
Your code has been rated at 8.48/10 (previous run: 8.48/10, +0.00)
Error 2020-08-16 22:04:01: stderr jediProxy Error (stderr) c:\Users\Aren Cambre.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\completion.py:594: DeprecationWarning: Deprecated since version 0.17.0. Use the project API instead, which means Script(project=Project(dir, sys_path=sys_path)) instead.
script = jedi.Script(
Error 2020-08-16 22:04:01: stderr jediProxy Error (stderr) c:\Users\Aren Cambre.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\completion.py:628: DeprecationWarning: Deprecated since version 0.16.0. Use Script(...).infer instead.
script.goto_definitions(), request["id"]
The text was updated successfully, but these errors were encountered: