4

I have installed some packages build from source using cmake, for example, opencv, it was built with many customized options , enabled cuda, openvino, etc.

but it can't be recognized by pip.

pip3 show opencv
WARNING: Package(s) not found: opencv

pip3 show python_opencv
WARNING: Package(s) not found: python_opencv

pip3 show python-opencv
WARNING: Package(s) not found: python-opencv

pip3 show opencv-python
WARNING: Package(s) not found: opencv-python

python3 -c "import cv2;print( cv2.__version__)"
4.5.5-openvino

So when I try to install some other packages like gym that depend on python-opencv, it will try to install python-opencv, and a lot of other dependent packages, like cmake.

Collecting opencv-python>=3.0
  Using cached https://pypi.some.mirror.site/packages/3c/61/ee4496192ed27f657532fdf0d814b05b9787e7fc5122ed3ca57282bae69c/opencv-python-4.5.5.64.tar.gz (89.9 MB)
  Running command pip subprocess to install build dependencies

...

  --
  -- General configuration for OpenCV 4.5.5 =====================================
  --   Version control:               unknown
  --

...
  [1/1102] Building CXX object CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.1f/sources/ade/source/assert.cpp.o
  [2/1102] Building CXX object CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.1f/sources/ade/source/alloc.cpp.o
  [3/1102] Building CXX object CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.1f/sources/ade/source/edge.cpp.o

...

how to let pip known that I have an opencv package installed. or how to hack pip to let it think this dependency is satisfied?

Mouse
  • 111
  • 1
  • 7
  • I think you might find this question helpful: https://stackoverflow.com/questions/18783390/python-pip-specify-a-library-directory-and-an-include-directory – cangozpi Jun 03 '22 at 20:22

0 Answers0