Ask Your Question
0

Problem install opencv 4.0 on windows 7 with pytho

asked 2018-11-22 04:47:20 -0600

spylyt gravatar image

updated 2018-11-22 04:50:20 -0600

berak gravatar image

Download newest package from https://sourceforge.net/projects/open....

Open a cmd and cd to pathtoopencv\build\python

RUN:

python setup.py install

SUCCESS Installed

Question:

If path doesn't, import cv2 can be done!

IF path changed, import cv2 fail.

error:

['C:\\ProgramData\\Anaconda3\\lib\\site-packages\\opencv-4.0.0-py3.7.egg\\cv2\\.
./../python/cv2/python-3.7', '', 'C:\\ProgramData\\Anaconda3\\Scripts', 'C:\\Pro
gramData\\Anaconda3\\python37.zip', 'C:\\ProgramData\\Anaconda3\\DLLs', 'C:\\Pro
gramData\\Anaconda3\\lib', 'C:\\ProgramData\\Anaconda3', 'C:\\ProgramData\\Anaco
nda3\\lib\\site-packages', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\open
cv-4.0.0-py3.7.egg', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\win32', 'C
:\\ProgramData\\Anaconda3\\lib\\site-packages\\win32\\lib', 'C:\\ProgramData\\An
aconda3\\lib\\site-packages\\Pythonwin', 'C:\\ProgramData\\Anaconda3\\lib\\site-
packages\\IPython\\extensions', 'C:\\Users\\Administrator\\.ipython']

ImportError: ERROR: recursion is detected during loading of "cv2" binary extensi
ons. Check OpenCV installation.

It seems like 'C:\ProgramData\Anaconda3\lib\site-packages\opencv-4.0.0-py3.7.egg\cv2\. ./../python/cv2/python-3.7' is set to wrong location.

So, how can i install with right command.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2018-11-24 06:51:33 -0600

You should copy pyd file and dlls to your anaconda environment in site-packages. That worked for me

edit flag offensive delete link more
0

answered 2018-12-13 04:01:11 -0600

RegW gravatar image

updated 2018-12-13 04:19:53 -0600

So building on sapfira5's answer - the process for me using Anaconda on Windows 10 with Python 2.7 was:

  1. Install Anaconda - selecting python 2.7 and installing the Microsoft VSCode when prompted.
  2. Downloaded the OpenCV 4.0.0 winpack from https://www.opencv.org/releases.html
  3. Click to run the download and extract into dir c:\tools\
  4. Start Anaconda python command prompt from installed icon, and type:
    • cd c:\tools\opencv\build\python
    • python setup.py build
    • python setup.py install
    • copy cv2\python-2.7\cv2.pyd c:\ProgramData\Anaconda2\lib\site-packages
    • copy ..\x64\vc15\bin\*.dll c:\ProgramData\Anaconda2\Library\bin
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-11-22 04:47:20 -0600

Seen: 2,519 times

Last updated: Dec 13 '18