Ubuntu 找不到Conda命令,路径在.bashrc中
操作系统:基本 安装anaconda3后,运行conda命令将显示:Ubuntu 找不到Conda命令,路径在.bashrc中,ubuntu,anaconda,Ubuntu,Anaconda,操作系统:基本 安装anaconda3后,运行conda命令将显示: conda: command not found .bashrc中的路径已附加正确的用户名 bashrc的一部分 enter c __el_LAST_EXECUTED_COMMAND="${BASH_COMMAND}" printf "\033]0;%s\007" "$1" } # Show the currently running command in the te
conda: command not found
.bashrc中的路径已附加正确的用户名
bashrc的一部分
enter c __el_LAST_EXECUTED_COMMAND="${BASH_COMMAND}"
printf "\033]0;%s\007" "$1"
}
# Show the currently running command in the terminal title:
# http://www.davidpashley.com/articles/xterm-titles-with-bash.html
update_tab_command()
{
# catch blacklisted commands and nested escapes
case "$BASH_COMMAND" in
*\033]0*|update_*|echo*|printf*|clear*|cd*)
__el_LAST_EXECUTED_COMMAND=""
;;
*)
put_title "${BASH_COMMAND}"
;;
esac
}
preexec_functions+=(update_tab_command)
;;
*)
;;
esac
# added by Anaconda3 2.4.0 installer
export PATH="/home/my_name/anaconda3/bin:$PATH"
此外:
您可能需要确保当前活动shell是bash(而不是csh) 如果已确保路径位于.bashrc中,请尝试以下步骤: $bash $conda-h
在这里,第一个bash命令将切换到当前终端中的bashshell。现在,由于您正在bash shell中执行,它应该能够从.bashrc for conda命令中找到路径。因此,在您将路径设置为.bashrc文件之后。。。转到终端并运行以下命令
source.bashrc
然后运行命令conda
如果给出了一个错误的解释器
,则运行以下命令cat~/anaconda3/bin/conda
您将获得以下信息:
#!/opt/example/anaconda3/bin/python
if __name__ == '__main__':
import sys
import conda.cli
sys.exit(conda.cli.main())
将第一行更改为指向正确的解释器在.bashrc或.bash_配置文件中设置正确的路径,
导出路径=/anaconda3/bin:$path
如果您已在主文件夹中安装了anaconda,则会起作用。不要将“../”添加到路径。确保在从web复制路径时,所有内容都正确粘贴到bash文件中,并且区分大小写和字体。执行此操作后,在首次使用conda命令之前,打开一个新的终端并键入源激活基
或源激活根
。通过键入conda-V
进行检查,它应该显示“conda版本号”您可能希望向我们显示的相关行。bashrc
还包括echo$PATH
的输出。已解决路径变量在bashrc中但未反映。手动导出成功。@algoProg我遇到了同样的问题。你说的“手动导出”是什么意思?你找到解决方案了吗?我也有同样的问题。。
#!/opt/example/anaconda3/bin/python
if __name__ == '__main__':
import sys
import conda.cli
sys.exit(conda.cli.main())