Das ist mein Programm:
Code: Select all
#define PY_SSIZE_T_CLEAN
#include
int main() {
Py_SetPythonHome(L"C:/Users/fxct/AppData/Local/Python/pythoncore-3.12-64");
// Py_SetPath(L"C:/Users/fxct/AppData/Local/Python/pythoncore-3.12-64/Lib;"
// L"C:/Users/fxct/AppData/Local/Python/pythoncore-3.12-64/Lib/site-packages");
Py_Initialize();
PyRun_SimpleString("import sys; print(sys.path)");
PyRun_SimpleString("import numpy; print('numpy loaded successfully')");
PyRun_SimpleString("import cv2; print('cv2 loaded successfully')");
Py_Finalize();
return 0;
}
Code: Select all
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\fxct\AppData\Local\Python\pythoncore-3.12-64\Lib\site-packages\cv2\__init__.py", line 181, in
bootstrap()
File "C:\Users\fxct\AppData\Local\Python\pythoncore-3.12-64\Lib\site-packages\cv2\__init__.py", line 153, in bootstra
p
native_module = importlib.import_module("cv2")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fxct\AppData\Local\Python\pythoncore-3.12-64\Lib\importlib\__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing cv2: The specified module could not be found.
Mobile version