When entering python in cmd, an error is reported: Warning: This Python interpreter is in a conda environment, but the environmentm

When entering python in cmd, although python can be opened, an error will appear. Because I just encountered and solved this problem, I would like to share it with you here. The solution is as follows:

1. Open cmd and enter:

conda info --envs

In the displayed environment, the name of the environment is before the asterisk *, and the path of the environment is after the asterisk. For example here is:

Environment name: base

Environment path: D:\anaconda3

2. Next enter:

conda activate myenv

3. Finally, enter the conda activate environment name or the path of the environment:

activate base

test result:

Follow up:

Every time I open python with the command line, the same warning appears, and I need to activate the environment first every time.

In addition, the default conda environment is called base, so just run: conda activate base.

Supongo que te gusta

Origin blog.csdn.net/weixin_52024937/article/details/125030934
Recomendado
Clasificación