如何处理Anaconda中的环境安装问题?

时间:2019-10-17 07:30:10

标签: python opencv anaconda

我正在尝试使用Anaconda提示符安装OpenCV。我已经尝试过anaconda和conda-forge版本。

使用上述article's命令后:-

conda install -c menpo opencv

我收到以下消息:-

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
Examining requests-oauthlib:   1%|▎                                                    | 2/347[00:00<00:06, 53.66it/s]\
Examining py:  44%|████████████████████████████▊                                    | 154/347 [00:00<00:00, 977.99it/s]|
Examining locket:  83%|█████████████████████████████████████████████████▊          | 288/347 [00:00<00:00, 1078.27it/s]/
failed


UnsatisfiableError: The following specifications were found to be incompatible with each other:



Package hdf5 conflicts for:
anaconda==2019.10 -> h5py==2.9.0=py36h5e291fa_0 -> hdf5[version='>=1.10.4,<1.10.5.0a0']
h5py -> hdf5[version='>=1.10.1,<1.10.2.0a0|>=1.10.2,<1.10.3.0a0|>=1.10.4,<1.10.5.0a0|>=1.8.18,<1.8.19.0a0|>=1.8.18,<1.9.0a0|>=1.8.20,<1.9.0a0']
hdf5
opencv -> hdf5[version='>=1.10.2,<1.10.3.0a0|>=1.8.18,<1.8.19.0a0|>=1.8.20,<1.9.0a0']
anaconda==2019.10 -> hdf5==1.10.4[build='h7ebc959_0|h530792d_0']
pytables -> hdf5[version='>=1.10.1,<1.10.2.0a0|>=1.10.2,<1.10.3.0a0|>=1.10.4,<1.10.5.0a0|>=1.8.18,<1.8.19.0a0|>=1.8.18,<1.9.0a0']

Error image

有人可以帮忙吗?我想在Anaconda的spyder中运行opencv

conda 4.7.12 Python 3.7.4 操作系统:Win10 x64

1 个答案:

答案 0 :(得分:0)

hdf5似乎与您的安装冲突。 您应该尝试使用conda创建一个新的虚拟环境,并在安装openCV之前从该虚拟环境中删除hdf5。这样您会很安全。

您可以执行以下操作:

conda create --name test_env
conda activate test_env
conda remove hdf5
conda install -c conda-forge opencv