Home > Blockchain >  Re-installing OpenCV (last time with dll "bundle" (exe) and now through opencv-python-cont
Re-installing OpenCV (last time with dll "bundle" (exe) and now through opencv-python-cont

Time:02-08

I have a problem and after searching without any solutions its time for my first question on this forum.

About a month ago i downloaded openCV (opencv-4.5.5-vc14...exe) and installed it. After about a month i now wanted to try some other trackers and therefore i need contrib.

So, i deleted the openCV directory. (this could have been stupid but i did).

When i install opencv-python-contrib (following instructions on github/opencv/opencv-python)

d:\OpenCV>pip install opencv-contrib-python
Collecting opencv-contrib-python
  Using cached opencv_contrib_python-4.5.5.62-cp36-abi3-win_amd64.whl (42.2 MB)
Requirement already satisfied: numpy>=1.17.3 in c:\users\martin\appdata\roaming\python\python39\site-packages (from opencv-contrib-python) (1.22.2)
Installing collected packages: opencv-contrib-python
Successfully installed opencv-contrib-python-4.5.5.62

d:\OpenCV>python
Python 3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print (cv2.__version__)
4.5.5
>>>

i get 4.5.5 (and no contrib add on).

I have updated pip and i have tried removing the version of python that i used in my earlier install.

I have checked path in environmental setting removing everything about opencv

What is it i´m missing?

When i uninstall (pip uninstall opencv-contrib-python) and try to import cv2 there is an error and files i have built in VS turns crazy.

When i reboot my computer and install (pip install opencv-contrib-python) we are happy campers again (besides contrib not working). as from the installation contrib is successfully installed but when i try a contrib command it does not work and the cv2.version says its not there.

Edit = When i open Visual studio/environment i have the opencv-contrib-python (4.5.5.62).

In my python/site-package i have a opencv_contrib_python-4.5.5.62.dist-info directory containning;

  • installer
  • license
  • license-3rd-party
  • metadata
  • record
  • request
  • top_level
  • wheel

Could anyone check their directory and see if they have the same so that i know that everything got installed?

I also have a cv2 map containing (amongst other files and directoris) cv2.pyd

Is there a PATH i need to fix?

Does anyone have any ideas?

Is there some information that i should provide?

I´m open to all suggestions, high and low ;)

i can use opencv in VS without any problems, its just the contrib that is missing.

sorry for my English, i´m a swede and English is far from something i brag about on my resume.

Best,

Martin

CodePudding user response:

Well now its working. I could not really say how, but it does so; problem solved..

  •  Tags:  
  • Related