2
votes

I want to install opencv in anaconda on windows and I tried bunch of ways but I could not install it my last attempt is :

conda install -c https://conda.binstar.org/menpo opencv

and i get :

Collecting package metadata (repodata.json): ...working... done Solving environment: ...working... failed

Note: you may need to restart the kernel to use updated packages.

and after that :

WARNING conda.base.context:use_only_tar_bz2(632): Conda is constrained to only using the old .tar.bz2 file format because you have conda-build installed, and it is <3.18.3. Update or remove conda-build to get smaller downloads and faster extractions.

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

  • anaconda==2019.03=py37_0 -> h5py==2.9.0=py37h5e291fa_0 -> hdf5[version='>=1.10.4,<1.10.5.0a0']
  • anaconda==2019.03=py37_0 -> importlib_metadata==0.8=py37_0 -> zipp[version='>=0.3.2']
  • h5py -> hdf5[version='>=1.10.4,<1.10.5.0a0']
  • hdf5
  • pkgs/main/win-64::importlib_metadata==0.8=py37_0 -> zipp[version='>=0.3.2']
  • pkgs/main/win-64::path.py==11.5.0=py37_0 -> importlib_metadata[version='>=0.5']
  • pkgs/main/win-64::zipp==0.3.3=py37_1
  • pytables -> hdf5[version='>=1.10.4,<1.10.5.0a0']
4

4 Answers

2
votes

We had the same issue described in the other answer with 3.7, however the command that worked is conda create --name py3 python=3.6 following by activate py3 and it should work for you.

2
votes

We also faced similar issue when installed Anaconda with python 3.7 . the following steps solved our problem . Created a new virtual environment with python 3.6 conda create -n new_env python=3.6 activate that environment conda activate new_env and then install opencv 3 conda install -c menpo opencv=3

1
votes

I think it is better to follow these steps :

  1. Open Anaconda Prompt and type following command : conda create -n tensorflow_cpu pip python=3.6
  2. After creating a new environment try this command line : activate tensorflow_cpu
  3. Then you can start installing the Tensorflow library by this command : pip install --ignore-installed --upgrade tensorflow==1.9
  4. After finishing installation close the prompt and reopen it .
  5. Type python in prompt and trying command import tensorflow as tf if you're directing to prompt without Error "well done "
1
votes

what worked for me is :

pip install opencv-contrib-python