首页 > 解决方案 > Conda virtual environment keeps using wrong version of Python

问题描述

I'm using Anaconda to create virtual environments. I've never had this problem before, but recently when I moved servers I noticed that every time I create a new virtual environment and activate it, it uses the wrong path for conda and python. Not to mention that typing python3 also returns a Python 3.6.9 version rather than the 3.8.5 version that I normally use with my base environment.

Here are the outputs for the stuff:

(base) user@server:/home/user$ which conda
/home/user/anaconda3/bin/conda
(base) user@server:/home/user$ which python
/home/user/anaconda3/bin/python
(base) user@server:/home/user$ conda activate venv
(venv) user@server:/home/user$ which conda
/home/user/anaconda3/condabin/conda
(venv) user@server:/home/user$ which python
/usr/bin/python

When I would use Anaconda virtual environments before, most of the paths were in /home/user/anaconda3/envs/ and not condabin. Does anybody know what I can do to fix this issue? Thanks.

标签: anacondavirtualenvconda

解决方案


推荐阅读