【发布时间】:2021-04-20 17:40:48
【问题描述】:
所以,最近我开始学习 Python for Data Sc。并安装了 miniconda。我打算用 VS Code 来练习。我将 python.exe 路径添加到 VS Code。但是当我从 VSCode 开始在我的默认 Git Bash 终端中执行 python 程序时,它给出了以下错误:
$ conda activate base
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If using 'conda activate' from a batch script, change your
invocation to 'CALL conda.bat activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- cmd.exe
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
在 Git Bash 终端中,我什至无法激活基本虚拟环境。虽然我关心另一个名为“xyz”的环境,但我也无法切换到它。
使用我的默认首选项(VSCode 和 Git Bash)帮助我解决错误。
【问题讨论】:
-
有几个问题问相同或相似的问题:stackoverflow.com/questions/56438511/… stackoverflow.com/questions/47246350/conda-activate-not-working stackoverflow.com/questions/43351596/… 这些问题中的任何一个都可以解决您的问题吗?
-
@saint_sharan - 进展如何?只需检查一下提供的信息是否有帮助。
-
@jill-cheng 您的解决方案有效。感谢那。但它正在工作,不是 source deactivate 和 conda deactivate 一样吗?此外,源 conda 已折旧
标签: python visual-studio-code anaconda data-science git-bash