anaconda navigator 在没有源命令的情况下无法直接启动

数据挖掘 蟒蛇
2022-03-16 00:56:47

当我运行以下命令
source ~/anaconda3/bin/activate root
时,它工作正常。我不想每次都运行这个命令。给我任何解决方案。

1个回答

您可以为此编写脚本 (.sh)。

STARTPATH=$(pwd)
cd ~/anaconda3/bin
case $1 in
    -j|--jupyter)
        shift
        source activate
        jupyter-lab
        ;;
    -n|--navigator)
        shift
        source activate
        anaconda-navigator
        ;;
esac
source deactivate
cd $STARTPATH

然后您可以通过 ./ 运行脚本,或者您可以将脚本放入/usr/local/bin并使其可执行chmod +x *yourfile*.sh

之后,您应该可以在控制台中输入:*yourfile* -n这将启动 anaconda 导航器。