简体   繁体   中英

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

So, recently I started to learn Python for Data Sc. and installed miniconda. I planned to use VS Code for practice. I added python.exe path to VS Code. But when I started executing python programs in my default Git Bash terminal from VSCode, it gave the following error:

$ 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'.

In the Git Bash Terminal, I cannot even activate the base virtual environment. Although I careted another environment named "xyz" but I am not able to switch to it either.

Help me with the error, with my default preferences(VSCode & Git Bash).

I activated the conda environment in the bash terminal with the following command:

  1. Use the command " source deactivate ",
  2. Then use the command " conda deactivate ",
  3. Now we can use the command " conda activate base " to activate the conda environment:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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