1、首先在Anaconda的安装路径如/Anaconda3/Scripts下,打开git bash窗口,然后输入下面的命令。
./conda init bash
运行之后,会在用户目录下面生成.bash_profile文件,文件内容如下:
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
if [ -f '/g/Python/anaconda3/Scripts/conda.exe' ]; then
eval "$('/g/Python/anaconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
fi
# <<< conda initialize <<<
2、再打开git bash窗口,会提示编码错误
UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 438: illegal multibyte sequence
3、这时打开高级系统设置,添加系统变量,即可。
变量名:PYTHONUTF8
变量值:1