Activate conda environment stopped working in vscode

北慕城南 提交于 2020-02-03 04:15:21

问题


I have noticed that conda activate environment stopped working in vscode integrated terminal with no obvious reason (I certainly did not install any new extensions, nor updated conda or vscode in the last few days).

Expected behaviour

After running conda activate environment I want the environment to be activated and be capable of using the environment python interpreter. Essentially it should look like this:

(base) lpravda-ml:~ lpravda$ conda activate rdkit-env
(rdkit-env) lpravda-ml:~ lpravda$ which python
/Users/lpravda/anaconda3/envs/rdkit-env/bin/python

This is what I can achieve using non-vscode terminal and work with conda as usual.

Actual behaviour This happens when I type in the same set of commands in vscode integrated terminal:

(base) lpravda-ml:~ lpravda$ conda activate rdkit-env
(rdkit-env) lpravda-ml:~ lpravda$ which python
/usr/local/bin/python

The environment seems to be switched on, however python still points to the system install python 2.7 and I have no idea why.

It used to be working like for years and now it broke down.

Note: When I run debugger in vscode the correct conda environment is selected and executed.

My setup:

OS: Mac OS X: 10.14.3
vscode: 1.31.1
conda: 4.6.7

Update ongoing issue with the following update:

OS: Mac OS X: 10.14.3
vscode: 1.33.3
conda: 4.6.8

Any idea what could possibly broke down?


回答1:


it is issue which you can read about it here, but I find this solution which solve the issue in this version. Also, as community said the problem with python interpreter and env gonna fix in next major update.



来源:https://stackoverflow.com/questions/54922399/activate-conda-environment-stopped-working-in-vscode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!