問題描述
我在 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 更新到 conda 4.x.conda 4.x 在運行 conda install 時在命令行中崩潰.這使得 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:
- 鎖定并忘記:對于我從不希望它們更新的包,我需要運行一個命令來鎖定它們一次,這樣它們就永遠不會作為依賴項更新
- 忽略更新:安裝包,同時忽略更新此更新中按名稱傳遞的某些包.
如果 2 個用例中只有一個是可能的、已知的或更容易的,請將其寫為答案.
If only one of the 2 use cases is possible or is known or is easier, please write it as answer.
推薦答案
這有兩點.首先,您可以通過更改配置選項來防止 conda 自動更新 auto_update_conda
到 False
:
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代碼>目錄.語法是
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
[下面的代碼] [放置在 conda-meta/pinned
] 強制 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 中鎖定軟件包的版本?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!