在 WSL Ubuntu 上安装 Conda 后出现 Bash 错误

在 WSL Ubuntu 上安装 Conda 后出现 Bash 错误

我按照桌面上 WSL Ubuntu 的官方手册安装 Conda。但是启动Conda后,每次启动终端时都会显示

-bash: eval: line 141: syntax error near unexpected token `('
-bash: eval: line 141: `export CONDA_PROMPT_MODIFIER='(base) ''
(base) root@DESKTOP-KT6HJIP:~#

在此 conda 中,一旦激活新环境,它就会显示新环境和基础环境的名称。

(base) root@DESKTOP-KT6HJIP:~# conda create -n new
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /root/miniconda3/envs/new



Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate new
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(base) root@DESKTOP-KT6HJIP:~# conda activate new
-bash: syntax error near unexpected token `('
(new) (base) root@DESKTOP-KT6HJIP:~#

而且,我无法在新环境中安装软件包。

我尝试过 WSL1/2 和 Ubuntu-22.04/20.04,但遇到了同样的问题。

任何人都可以帮我解决这个问题吗?

相关内容