問題描述
當我運行以下命令時:conda env create -f virtual_platform_mac.yml
我收到此錯誤
Collecting package metadata (repodata.json): done
Solving environment: failed
ResolvePackageNotFound:
- pytables==3.4.2=np113py35_0
- h5py==2.7.0=np113py35_0
- anaconda==custom=py35_0
我該如何解決這個問題?
我正在使用 Mac OS X.
I am working on Mac OS X.
推薦答案
Conda v4.7 刪除了 Anaconda Cloud 存儲庫的一個分支,稱為 free 頻道,以提高求解性能.不幸的是,這包括許多從未移植到保留的存儲庫分支的舊包.此處失敗的要求會受此影響.
Conda v4.7 dropped a branch of the Anaconda Cloud repository called the free channel for the sake of improving solving performance. Unfortunately, this includes many older packages that never got ported to the repository branches that were retained. The requirements failing here are affected by this.
Conda 提供了一種通過 restore_free_channel
配置選項恢復對存儲庫這一部分的訪問的方法.您可以通過查看來驗證這是不是問題
Conda provides a means to restore access to this part of the repository through the restore_free_channel
configuration option. You can verify that this is the issue by seeing that
conda search pytables=3.4.2[build=np113py35_0]
失敗,而
CONDA_RESTORE_FREE_CHANNEL=1 conda search pytables=3.4.2[build=np113py35_0]
成功找到了包,其他的也是如此.
successfully finds the package, and similarly for the others.
如果您希望經常需要較舊的軟件包,則可以全局設置該選項,然后繼續安裝:
If you expect to frequently need older packages, then you can globally set the option and then proceed with installing:
conda config --set restore_free_channel true
conda env create -f virtual_platform_mac.yml
選項 2:臨時設置
與所有 Conda 配置選項一樣,您也可以使用相應的環境變量來臨時恢復僅為命令的訪問權限:
Option 2: Temporary Setting
As with all Conda configuration options, you can also use the corresponding environment variable to temporarily restore access just for the command:
Unix/Linux
CONDA_RESTORE_FREE_CHANNEL=1 conda env create -f virtual_platform_mac.yml
Windows
SET CONDA_RESTORE_FREE_CHANNEL=1
conda env create -f virtual_platform_mac.yaml
(是的,我意識到 ..._mac.yaml
的認知失調,但 Windows 用戶也需要幫助.)
(Yes, I realize the cognitive dissonance of a ..._mac.yaml
, but Windows users need help too.)
手動包含頻道
也可以手動將頻道包含為要搜索的頻道:
One can also manually include the channel as one to be searched:
conda search -c free pytables=3.4.2[build=np113py35_0]
請注意,這些方法中的任何一種都只會在此特定搜索中使用 免費 頻道,并且未來的任何搜索或對 env 的更改都不會搜索該頻道.
Note that any of these approaches will only use the free channel in this particular search and any future searches or changes to the env will not search the channel.
如果您有一個特定的環境,您總是希望能夠訪問 免費 頻道,但又不想全局設置此選項,則可以改為僅為該環境設置配置選項.
If you have a particular env that you always want to have access to the free channel but you don't want to set this option globally, you can instead set the configuration option only for the environment.
conda activate my_env
conda config --env --set restore_free_channel true
類似的效果可以通過在 etc/conda/activate.d
和 etc/conda/中的腳本中設置和取消設置
文件夾,分別.請參閱 the示例文檔.CONDA_RESTORE_FREE_CHANNEL
變量來實現deactivate.d
A similar effect can be accomplished by setting and unsetting the CONDA_RESTORE_FREE_CHANNEL
variable in scripts placed in the etc/conda/activate.d
and etc/conda/deactivate.d
folders, respectively. See the documentation for an example.
這篇關于創建 Conda 環境時如何修復“ResolvePackageNotFound"錯誤?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!