我已经为Linux的Windows子系统安装了Miniconda
。每次启动VScode终端时,我都会收到消息:conda command not found
。只有当我键入以下命令时,我才能使用conda
:
source ~/.bashrc
export PATH="/home/user/miniconda3/bin:$PATH"
有办法解决吗?
我也把export PATH="/home/user/miniconda3/bin:$PATH"
放在了ubuntu终端上,但它没有改变任何东西。
确保您的主目录中有一个名为.bash_profile的文件。这个文件将调用你的.bashrc文件。它应该是自动生成的,无论是在设置操作系统时还是在创建.bashrc文件时,但也可以手动创建:
.bash_profile:
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc
.bashrc:
export PATH="/home/user/miniconda3/bin:$PATH"
如果问题只出现在VSCode中,这个线程可能也会有所帮助:VSCode集成终端不;t加载.bashrc或.bash_profile