VSCode conda activate base giving CommandNotFoundError

后端 未结 4 1433
庸人自扰
庸人自扰 2021-02-09 01:17

I have Anaconda and Visual Studio Code installed on my computer. My default terminal for VS Code is Git Bash. When I open a new terminal in VSCode, it immediately runs the follo

4条回答
  •  暖寄归人
    2021-02-09 01:35

    I had exactly the same error as you. I solved it with a tip from a Python course in Udacity

    Open Git Bash command line (NOT within VSC terminal) and go to your home folder, e.g., /c/Users/arman. Then run the following two commands but replace [YOUR_PATH] with your Anaconda installation folder

    echo 'export PATH="$PATH:[YOUR_PATH]:[YOUR_PATH]/Scripts"' >> .bashrc
    echo 'alias python="winpty python.exe"' >> .bashrc
    

    For example in my case, as I have miniconda, I executed:

    echo 'export PATH="$PATH:/c/Users/arman/Miniconda3:/c/Users/arman/Miniconda3/Scripts"' >> .bashrc
    echo 'alias python="winpty python.exe"' >> .bashrc
    

    After this executing those lines, i.e., creating the .bashrc file, then run:

    source .bashrc
    

    Afterwards, open VSC and try running or debugging a python program. It worked for me!

提交回复
热议问题