0

Win 10 x64 Python 3.6

I'm trying to install the latest version of opencv-contrib-python from PyPi into a conda environment. I did this very thing yesterday with no issues but today its broken.

From the conda commandline (as Admin) in my activated env I have tried

pip install opencv-contrib-python
pip install opencv-contrib-python --user
pip install opencv-python
pip install opencv-python --user

All throw the same pages & pages full of errors. Some highights,

ERROR: Command errored out with exit status 1:
   command: 'C:\ProgramData\Anaconda3\envs\genicam\python.exe' 'C:\ProgramData\Anaconda3\envs\genicam\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\NICBWT~1\AppData\Local\Temp\tmp98_vz8u5'
       cwd: C:\Users\NICBWT~1\AppData\Local\Temp\pip-install-71z9rl7t\opencv-contrib-python_387a51900d48422f8ed4ed222402118d
  Complete output (1205 lines):


  --------------------------------------------------------------------------------
  -- Trying 'Ninja (Visual Studio 17 2022 x64 v143)' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Ninja

    does not support platform specification, but platform

      x64

    was specified.

Then LOADS of stuff finally ending with...

ERROR: Could not build wheels for opencv-contrib-python, which is required to install pyproject.toml-based projects

There is literally pages of this. Most of it looks like CMake generated output, searching & finding stuff but I've never seen anything like that with anyother OpenCV install before.

I have updated pip and setup-tools, still that same errors. I have attempted all fixes I could find on here, still the same errors. I have tried installing directly from a cloned git repo, still the same errors

Anyone seen this kind of behaviour before?

DrBwts
  • 3,470
  • 6
  • 38
  • 62

1 Answers1

0

You may need to run

pip install --upgrade wheel

before running

pip install opencv-contrib-python

It is the only other thing I can think of updating since you updated pip and setup-tools.

EDIT: Found a similar question that shows almost the same answer as well as other answers and useful info.

  • I get `Requirement already satisfied` when I try to update `wheel` – DrBwts Mar 30 '23 at 16:38
  • Hmm, I wonder if the version of one of these packages is too high. If you can find the specified versions you need, you can try ```pip install opencv-contrib-python==VERSION_NUMBER``` with the versions you need instead of explicitly the newest version. You can do this with setuptools and wheel as well. – UnsanitizedInput Mar 30 '23 at 16:55