繁体   English   中英

为什么在 VS Code 中使用 MiniConda 时出现错误?

[英]Why am I getting an error while using MiniConda in VS Code?

所以,最近我开始学习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)帮助我解决错误。

我使用以下命令在 bash 终端中激活了 conda 环境:

  1. 使用命令“ source deactivate ”,
  2. 然后使用命令“ conda deactivate ”,
  3. 现在我们可以使用命令“ conda activate base ”来激活 conda 环境:

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM