可以在Anaconda中锁定软件包的版本吗? [英] Is it possible to lock versions of packages in Anaconda?

查看:148
本文介绍了可以在Anaconda中锁定软件包的版本吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows XP上安装了Anaconda 3 2.3.0.应该是最新版本anaconda支持Windows xp 的版本,因为它包含python 3.4.3,而python 3.4.x是支持Windows xp的python的最新版本.

I installed Anaconda 3 2.3.0 on Windows xp. It is supposed to be the last version of anaconda to support windows xp as it contains python 3.4.3, and python 3.4.x is the last version of python to support windows xp.

使用

conda安装

conda install

,其依赖项之一是将conda更新为conda4.x.运行conda install时,conda 4.x在命令行中崩溃.这使anaconda无法使用,因此我卸载了anaconda.

,one of its dependencies was updating conda to conda 4.x. conda 4.x crashed in the commandline when running conda install . This made anaconda unusable that i uninstalled anaconda.

我的问题是,可以锁定软件包的版本吗?对于这两种用例:

My question, is it possible to lock versions of packages ? For the two use cases:

  • 锁定并忘记:对于我从不希望更新的软件包,我需要运行命令以将其锁定一次,这样它们就永远不会依赖更新
  • 忽略更新:安装软件包,而忽略更新此更新中通过名称传递的某些软件包.

如果两个用例中只有一种是可能的,已知的或更容易的,请写为答案.

If only one of the 2 use cases is possible or is known or is easier, please write it as answer.

推荐答案

这有两个含义.首先,您可以通过更改配置选项

There are two bits to this. First, you can prevent conda from auto-updating by changing the configuration option auto_update_conda to False:

conda config --set auto_update_conda False

另一点是将软件包固定到某些版本.对于那些不想更新的软件包,可以通过在环境的conda-meta目录中名为pinned的文件中添加一行(您可能需要创建)来固定版本.语法是

The other bit is to pin packages to certain versions. For those packages you don't want to update, you can pin the version by adding a line to a file called pinned (you might need to create it) in the environment's conda-meta directory. The syntax is

[放置在中的下面的代码]强制NumPy继续使用1.7系列(该版本以1.7开头),并强制SciPy严格采用0.14.2版本:

[The code] below [placed in conda-meta/pinned] forces NumPy to stay on the 1.7 series, which is any version that starts with 1.7, and forces SciPy to stay at exactly version 0.14.2:

numpy 1.7.*
scipy ==0.14.2

请参见

See the documentation for more information.

这篇关于可以在Anaconda中锁定软件包的版本吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆