[英]Why did the python version not switch after conda switched the environment?
python3.7.12 should be the python version of the hsm environment python3.7.12应该是hsm环境的python版本
(hsm) leelee@ubuntu-PowerEdge-T440:~/tools/hsm-master/predict$ which python
/home/leelee/miniconda3/envs/hsm/bin/python
(hsm) leelee@ubuntu-PowerEdge-T440:~/tools/hsm-master/predict$ /home/leelee/miniconda3/envs/hsm/bin/python
Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:21)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
But if I type python
directly, it will return a 3.9.5 python version但是如果我直接输入
python
,它会返回一个3.9.5的python版本
(hsm) leelee@ubuntu-PowerEdge-T440:~/tools/hsm-master/predict$ python
Python 3.9.5 (default, Jun 4 2021, 12:28:51)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
I guess when I type python
, I entered /home/leelee/miniconda3/bin/python
我猜当我输入
python
,我输入了/home/leelee/miniconda3/bin/python
(hsm) leelee@ubuntu-PowerEdge-T440:~/tools/hsm-master/predict$ which -a python
/home/leelee/miniconda3/envs/hsm/bin/python
/home/leelee/miniconda3/bin/python
(hsm) leelee@ubuntu-PowerEdge-T440:~/tools/hsm-master/predict$ /home/leelee/miniconda3/bin/python
Python 3.9.5 (default, Jun 4 2021, 12:28:51)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
Why does this happen and how can I solve it?为什么会发生这种情况,我该如何解决?
Looks like you added Python to the system PATH, which is not recommended when using conda.看起来你在系统PATH中添加了Python,在使用conda时不推荐这样做。 Simply check your PATH after conda activation and have a look at the sequence of the Python folders.
只需在 conda 激活后检查您的 PATH 并查看 Python 文件夹的顺序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.