默认 python 命令指向 anaconda 而不是 /usr/bin/python

默认 python 命令指向 anaconda 而不是 /usr/bin/python

我在尝试从 18.10 更新到 Ubuntu 19.04 时不知何故弄乱了我的 python 安装。

python 命令指向我的 anaconda 的 python 而不是/usr/bin/python.

> which python
/home/username/anaconda3/bin/python

我的$路径:

--> echo $PATH
/home/username/.nvm/versions/node/v11.13.0/bin:/home/username/anaconda3/bin:/home/username/anaconda3/condabin:/usr/local/cuda-9.0/bin:/home/username/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin}

.bashrc:

cat .bashrc | grep anaconda
__conda_setup="$(CONDA_REPORT_ERRORS=false '/home/username/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
    if [ -f "/home/username/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/home/username/anaconda3/etc/profile.d/conda.sh"
        \export PATH="/home/username/anaconda3/bin:$PATH"

cat .bashrc | grep python
nothing

cat .bashrc | grep PATH
export PATH=/usr/local/cuda-9.0/bin${PATH:+:$PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
        \export PATH="/home/username/anaconda3/bin:$PATH"

答案1

更改 $PATH 以将系统目录(等)放在/usr/binAnaconda/bin安装之前。可能它设置在您的.bashrc.

相关内容