简体   繁体   English

“conda install -c conda-forge python”导致 anaconda 分发停止工作

[英]"conda install -c conda-forge python" causes anaconda distribution to stop working

I tried running conda install -c conda-forge python .我尝试运行conda install -c conda-forge python The installed python package causes Anaconda python to stop working.安装的python package导致Anaconda python停止工作。 When I type python on the console, nothing happens.当我在控制台上输入python时,什么也没有发生。 Did anyone encounter the same problem?有没有人遇到同样的问题? Any fixes?有什么修复吗?

The latest python version v3.9.13 from conda-forge channel will break the anaconda package, at least on my PC.来自 conda-forge 频道的最新 python 版本 v3.9.13 将破坏 anaconda package,至少在我的 PC 上。 I don't know if anyone else faces the same problem.我不知道其他人是否面临同样的问题。

I am using Windows 10. I am running Anaconda 2022.05.我正在使用 Windows 10。我正在运行 Anaconda 2022.05。

TLDR; TLDR; You need to activate the environment with conda activate base to use it in the command prompt in windows.您需要使用conda activate base激活环境才能在 windows 的命令提示符中使用它。 (check below for more details, including virtual env) (查看下方了解更多详细信息,包括虚拟环境)

Explaination解释

Even though you have installed python with conda install -c conda-forge python , this probably happened to your base environment, which is still inaccessible because you need to do conda activate base (in Linux OS conda source base ).即使您使用 conda conda install -c conda-forge python ,这可能发生在您的基础环境中,仍然无法访问,因为您需要执行conda source base conda activate base (在 ZEDC9F0A5A5D57797BF68E37364743 中)。 This is done to run python successfully outside the anaconda prompt (you seem to be using cmd with admin privileges ).这样做是为了在anaconda 提示符之外成功运行 python (您似乎正在使用具有管理员权限的 cmd )。

Also like others mentioned in the comments, conda is usually used to make isolated environments for each application.也像评论中提到的其他人一样,conda 通常用于为每个应用程序创建隔离环境。 As seen per the documentation, and below : 如文档所示,如下所示

conda create -n <env_name>

conda activate <env_name>

conda install -c conda_forge python (This can be combined into the first line, by adding python after <env_name>, even with a specific version like python=3.8 ) conda install -c conda_forge python (这可以合并到第一行,通过在 <env_name> 之后添加 python,即使使用特定版本,例如python=3.8

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

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