Closed rrmistry closed 5 years ago
I was able to isolate the problem to the following code location:
https://github.com/microsoft/vscode-python/blob/66de533a2a72276f16d82d6d4494cebee47e63bd/src/client/common/terminal/environmentActivationProviders/commandPrompt.ts#L40-L48 where the extension is trying to find the appropriate activate.bat
file in the sequence of most likely locations. But I think there may have been a recent change in conda which no longer creates this file. I haven't been able to confirm this yet.
Looks like re-installing anaconda fixed the issue.
The new VS Code python terminal initialization is:
D:\repos\VSTS\righteous-ai\righteous-pulse>D:/Anaconda3/Scripts/activate
(base) D:\repos\VSTS\righteous-ai\righteous-pulse>conda activate righteous-pulse
(righteous-pulse) D:\repos\VSTS\righteous-ai\righteous-pulse>
Curious as to how this occurred in the first place.
I'll close this issue now. My apologies for any confusion.
I get the following error when selecting my conda environment in VS Code:
Snippet of the error output:
The correct conda environment is not activated so this causes issues when running python notebooks through the integrated IPython Kernel.
Environment data
4.7.5
| python version (conda env)3.6.5
"python.jediEnabled": false
"python.terminal.activateEnvironment": true
"python.pythonPath": "D:\\Miniconda3\\envs\\righteous-pulse\\python.exe"
"python.condaPath": "D:\\Anaconda3\\Scripts\\conda.exe"
Expected behaviour
No error during conda environment activation. Language server initializes with the proper conda environment.
Actual behaviour
Conda environment is not activated successfully. Language server using base conda environment.
Steps to reproduce:
Create conda environment using
conda env update --name <your-env> --file environment.yml
Whereenvironment.yml
has the form:Workaround
Manually create an environment activation file under
<your-env>/Scripts/activate.bat
that VS Code triggers in the background.For me I had to create it under
D:\Miniconda3\envs\righteous-pulse\Scripts\activate.bat
with the file contents:which executes "activate.bat" found in the base conda environment.
Possible related issue