简体   繁体   English

我是否需要在 conda 基础环境中更新/升级 Python 版本?

[英]Do I need to update/upgrade Python version at conda base environment?

Python version at my base conda environment is 3.7.12.我的基本 conda 环境中的 Python 版本是 3.7.12。 Do I need to update it to a newer version (3.10) in order to properly create new environments with Python 3.10?我是否需要将其更新到较新的版本 (3.10) 才能使用 Python 3.10 正确创建新环境?

Is there any problem in maintaining base environment Python version at 3.7 if I'd like to use newer version of packages and Python itself in other environments?如果我想在其他环境中使用更新版本的包和 Python 本身,在 3.7 维护基础环境 Python 版本是否有任何问题?

I've just reinstalled anaconda ( conda install anaconda ) after trying to update conda and python but being unsuccessful because of conflicts.在尝试更新 conda 和 python 但由于冲突而失败后,我刚刚重新安装了 anaconda ( conda install anaconda )。 After reinstalling anaconda I managed to update conda from 4.10.3 to 4.13.重新安装 anaconda 后,我设法将 conda 从 4.10.3 更新到 4.13。 Now I'm trying to conda install python=3.10 and it's taking HOURS !现在我正在尝试conda install python=3.10并且需要HOURS Literally: I started it 24h ago and it keeps Examining conflict for ... a list of packages that updates every 10 or 15 minutes, with just slight changes.从字面上看:我在 24 小时前启动了它,它一直Examining conflict for ...每 10 或 15 分钟更新一次的软件包列表,只有轻微的变化。
Is this list of packages being examined so long because anaconda installs all of them at the base environment when it's installed for the first time?是否因为 anaconda 在第一次安装时将所有这些软件包都安装在基础环境中而检查了这么长的软件包列表?

Do I need to update it to a newer version (3.10) in order to properly create new environments with Python 3.10?我是否需要将其更新到较新的版本 (3.10) 才能使用 Python 3.10 正确创建新环境?

no.不。 You can have python version X in your base, create an env with python version Y and another one with python version Z. That is the advantage of having conda managed environments that you can switch to different installed packages using a conda activate command.您可以在您的基础中使用 python 版本 X,使用 python 版本 Y 创建一个环境,并使用 python 版本 Z 创建另一个环境。这是拥有conda托管环境的优势,您可以使用conda activate命令切换到不同的已安装包。

Is there any problem in maintaining base environment Python version at 3.7 if I'd like to use newer version of packages and Python itself in other environments?如果我想在其他环境中使用更新版本的包和 Python 本身,在 3.7 维护基础环境 Python 版本是否有任何问题?

No, the general recommendation is also to not mess with your base env at all.不,一般建议也不要弄乱您的基本环境。 Create an environment if you have specific needs (eg one for each of your projects)如果您有特定需求,请创建一个环境(例如,为您的每个项目创建一个环境)

Is this list of packages being examined so long because anaconda installs all of them at the base environment when it's installed for the first time?是否因为 anaconda 在第一次安装时将所有这些软件包都安装在基础环境中而检查了这么长的软件包列表?

Yes, anaconda installs a very long list of packages when first installed with a complicated mix of dependencies.是的,anaconda 在首次安装时会安装很长的软件包列表,其中包含复杂的依赖项组合。 When you now try to update your python version, probably all packages need to be changed to be compatible, which creates a very complex net of dependencies, hence the recommendation in the two answers above: don't try to mess with your base env and create a new env with your desired python version and only those packages that you need for a specific project (ie don't just install all anaconda packages into new environments)当您现在尝试更新您的 python 版本时,可能需要更改所有包以兼容,这会创建一个非常复杂的依赖网络,因此上面两个答案中的建议是:不要尝试弄乱您的基本环境和使用您想要的 python 版本创建一个新环境,并且只创建特定项目所需的那些包(即不要只将所有anaconda包安装到新环境中)

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

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