linux 中 退出conda环境设置python3环境变量

 

001、conda基础环境

(base) [root@pc1 home]# python3 --version
Python 3.11.4
(base) [root@pc1 home]#

 

002、退出conda base环境

(base) [root@pc1 home]# conda deactivate
[root@pc1 home]# python3 --version
bash: python3: command not found...
Similar command is: 'python'

 

003、查找python3

[root@pc1 home]# find $HOME -name "python3"
/root/anaconda3/pkgs/python-3.11.4-h7a1cb2a_0/bin/python3
/root/anaconda3/pkgs/ipykernel-6.19.2-py311h6410fe4_0/share/jupyter/kernels/python3
/root/anaconda3/bin/python3
/root/anaconda3/share/jupyter/kernels/python3

 

004、建立软链接

[root@pc1 home]# ln -s /root/anaconda3/bin/python3 /usr/bin/python3     
[root@pc1 home]# python3 --version           ## 测试python3
Python 3.11.4

 .

 

posted @ 2023-09-15 12:09  小鲨鱼2018  阅读(379)  评论(0编辑  收藏  举报