Ask Your Question
0

import cv2 error on windows: missing configuration files

asked 2020-07-13 12:19:24 -0600

updated 2020-07-14 01:42:29 -0600

berak gravatar image

OpenCV = from master branch 7/10/20 Operating System / Platform => Windows 64 Bit Win10 Compiler => Visual Studio 2019

problem: I successfully built opencv in the latest cmake, and then built in VS. My PC recognizes python but does not recognize cv2. I installed both opencv and python in the c:\ drive. I tried adding these paths to my user environment variables, no luck. All my python paths in cmake are also correct. What could be the problem here?

error:

>>> C:\>python
Python 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 10:41:24) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python37\cv2\__init__.py", line 96, in <module>
bootstrap()
File "C:\Python37\cv2\__init__.py", line 62, in bootstrap
], True)
File "C:\Python37\cv2\__init__.py", line 56, in load_first_config
raise ImportError('OpenCV loader: missing configuration file: {}. Check OpenCV installation.'.format(fnames))
ImportError: OpenCV loader: missing configuration file: ['config-3.7.py', 'config-3.py']. Check OpenCV installation.

My paths:

PYHTONPATH:
C:\Python37\python.exe
C:\Python37\include
C:\Python37\libs
C:\Python37\lib
C:\Python37\site-packages
C:\Python37\Lib\site-packages\numpy\core\include
C:\Python37\Lib\site-packages\cv2\python-3.7
C:\Python37\Lib\site-packages\cv2
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-07-16 21:36:02 -0600

You should try pycharm and anaconda, they have better support for python and easy configuration.It might be better to ask on stackoverflow, where many people use Visual Studio 2019.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-07-13 12:19:03 -0600

Seen: 1,985 times

Last updated: Jul 14 '20