简体   繁体   中英

Anaconda3 opencv conflicts with hdf5 when trying to install

I am a bit new to using anaconda so do forgive me if this is a stupid question but could someone please help me with the following problem?

opencv will not install in my brand new anaconda 3 installation. When I execute the command I found on THIS page it does this:

(test) c:\Users\Caleb\program_shit>conda install -c conda-forge opencv
Collecting package metadata (current_repodata.json): done
Solving environment: failed with current_repodata.json, will retry with next repodata source.

Collecting package metadata (repodata.json): done
Solving environment: failed
Initial quick solve with frozen env failed.  Unfreezing env and trying             again.
Solving environment: failed

UnsatisfiableError: The following specifications were found to be incompatible with a past
explicit spec that is not an explicit spec in this operation (hdf5):

  - opencv -> hdf5[version='>=1.10.2,<1.10.3.0a0']

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



Package hdf5 conflicts for:
defaults/win-64::hdf5==1.10.4=h7ebc959_0
defaults/win-64::pytables==3.5.2=py37h1da0976_1 -> hdf5[version='>=1.10.4,<1.10.5.0a0']
_anaconda_depends -> blaze -> pytables[version='>=3.0.0'] -> hdf5[version='1.8.18|1.8.18.*,>=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']
Package h5py conflicts for:
defaults/win-64::h5py==2.9.0=py37h5e291fa_0

'

Tried reinstalling my anaconda from scratch it didn't fix it but it started giving this new error as apposed to just never finishing solving the env.I also was running it as admin in every case. Also from what i read on the internet it is a really bad idea to remove the hdf5 package as it is needed for the jupyter functionality.

If anyone knows how to make opencv install i would really appreciate it.

if you need any clarifications or more info please don't hesitate to ask

I would suggest creating a virtual environment . The reason for creating a virtual environment is that it will leave the conda (base) environment alone and you will have an environment to use opencv that has the necessary dependencies.

Also in a virtual environment, particularly if you mess it up, you can just delete it and you will staff have a perfectly working base environment.

conda create --name opencv-env

Then follow the instructions to activate the environment, should be something like

conda activate opencv-env

Then remove the conflicting packages that you probably don't need!

conda remove pytables h5py hdf5

And then try to install opencv

conda install -c conda-forge opencv

This might not be EXACLTY correct but you should get the overall idea

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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