How to debug C++ code in a python program using VS2017?
I installed cv2 in release mode and everything is fine. Now I want to debug my python and C++ code (https://docs.microsoft.com/en-us/visu...) Now instead of release mode I install cv2 in debug mode : I copy build\opencv\lib\python3\Debug\cv2.cp36-win_amd64.pyd in I have got eror :
Unhandled exception at 0x0000000065CC9E02 (python36_d.dll) in python.exe: 0xC0000005: Access violation reading location 0x0000000000000025. occurred
stack trace is : python36_d.dll!PyUnicode_InternInPlace(_object * * p) Line 15272 C python36_d.dll!PyUnicode_InternFromString(const char * cp) Line 15307 C python36_d.dll!PyImport_Import(_object * module_name) Line 1711 C python36_d.dll!PyImport_ImportModule(const char * name) Line 1257 C cv2.cp36-win_amd64.pyd!_import_array() Line 1466 C++
cv2.cp36-win_amd64.pyd!PyInit_cv2() Line 1785 C++ [External Code] <frozen importlib._bootstrap="">!_call_with_frames_removed Line 219 Python <frozen importlib._bootstrap_external="">!create_module Line 922 Python <frozen importlib._bootstrap="">!module_from_spec Line 571 Python <frozen importlib._bootstrap="">!_load_unlocked Line 658 Python <frozen importlib._bootstrap="">!_find_and_load_unlocked Line 955 Python <frozen importlib._bootstrap="">!_find_and_load Line 971 Python colorRange.py!<module> Line 2 Python
my program is :
import numpy as np
import cv2 as cv # <-- EXception is here
img = cv.imread("g:/lib/opencv/samples/data/baboon.jpg")
@LBerger, Python3 is 64-bit?
I think so. print( sys.version) gives
Something weird is in dll loaded I have got python36.dll and python36_d.dll. Could it be a problem
I think that numpy must be compiled in debug