简体   繁体   English

在 windows 上使用 python 的默认版本?

[英]Using default version of python on windows?

I recently installed the Anaconda version of Python.我最近安装了Anaconda版本的Python。 Now when I type python into the terminal it opens the Anaconda distribution rather than the default distribution.现在,当我在终端中键入 python 时,它会打开 Anaconda 分布而不是默认分布。 How do I get it to use the default version for the command python on windows?如何让它在 windows 上使用命令 python 的默认版本? I have added the distribution to the path but when i type python --version, it shows the conda version and not the system version.我已将分发添加到路径中,但是当我输入 python --version 时,它显示的是 conda 版本而不是系统版本。

Conda manipulates the PATH variable when it activates environments. Conda 在激活环境时会操纵PATH变量。 A default install will auto-activate the base environment, which results in giving it precedence over other software accessible from PATH .默认安装将自动激活基础环境,从而使其优先于可从PATH访问的其他软件。 If you would prefer Conda not to auto-activate base by default, then set this in the configuration:如果您希望 Conda 默认不自动激活base ,请在配置中设置:

conda config --set auto_activate_base false

Documentation文档

$ conda config --describe auto_activate_base
# # auto_activate_base (bool)
# #   Automatically activate the base environment during shell
# #   initialization.
# # 
# auto_activate_base: true

Otherwise, one can always do an ad hoc deactivation with conda deactivate .否则,总是可以使用conda deactivate进行临时停用。 This latter operation assumes the Conda shell functions are initialized .后一个操作假定Conda shell 函数已初始化

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM