简体   繁体   English

OpenCV-CUDA Win10。 导入时未找到 Python 模块

[英]OpenCV-CUDA Win10. Python Module Not Found on Import

So, I have been working on getting opencv with nvidia gpu support for a few days now and can't get python to import cv2 (importing precompiled opencv-python works as expected).所以,我一直在努力让 opencv 与 nvidia gpu 支持几天,现在不能让 python 导入 cv2 (导入预编译的 opencv.python 作品) Out of frustration I just deleted then unzipped the opencv_contrib_master and, to my surprise, a few new lines popped up in CMake:出于沮丧,我刚刚删除然后解压缩了 opencv_contrib_master,令我惊讶的是,CMake 中弹出了几行新行:

Under Ungrouped Entries:在未分组条目下:

BUILD_OPENCV_CUDA

Under Python 3:在 Python 3 下:

install path:                C:/ProgramData/Anaconda3/Lib/site-packages/cv2/python-3.7

Under OpenCV:在 OpenCV 下:

OPENCV_PYTHON3_VERSION 

Great.伟大的。 Progress.进步。 But now a new foe appears:但现在出现了一个新的敌人:

CMake Warning at cmake/OpenCVGenSetupVars.cmake:54 (message):
  CONFIGURATION IS NOT SUPPORTED: validate setupvars script in install
  directory
Call Stack (most recent call first):
  CMakeLists.txt:967 (include)

The above error is mentioned here and states the error is related to the python configuration. 此处提到了上述错误,并指出该错误与 python 配置有关。 I thought the PY3 config looked ok:我认为 PY3 配置看起来不错:

PYTHON3_EXECUTABLE                C:/ProgramData/Anaconda3/python.exe
PYTHON3_INCLUDE_DIR               C:/ProgramData/Anaconda3/include
PYTHON3_INCLUDE_DIR2
PYTHON3_LIBRARY                   C:/ProgramData/Anaconda3/libs/python37.lib
PYTHON3_LIBRARY_DEBUG             PYTHON_DEBUG_LIBRARY-NOTFOUND
PYTHON3_NUMPY_INCLUDE_DIRS        C:/ProgramData/Anaconda3/Lib/site-packages/numpy/core/include
PYTHON3_PACKAGE_PATH              C:/ProgramData/Anaconda3/Lib/site-packages

Edit 10: on a subsequent installation I saw Cmake enters numpy library from User/Roaming instead of ProgramData/Anaconda3.编辑 10:在随后的安装中,我看到 Cmake 从 User/Roaming 而不是 ProgramData/Anaconda3 进入 numpy 库。 I do not know if the difference affects build success.我不知道差异是否会影响构建成功。

I noticed these were missing (not sure if it matters):我注意到这些丢失了(不确定是否重要):

CUDA_nvToolsExt_LIBRARY-NOTFOUND
CUDA_nvcuvenc_LIBRARY-NOTFOUND
CUDA_nvcuvid_LIBRARY-NOTFOUND

Along with BLAS/LAPLACK/EIGEN.与 BLAS/LAPLACK/EIGEN 一起。 I still am not unclear whether these are necessary for python handle.我仍然不清楚 python 手柄是否需要这些。

Using GTX 1080, so I only kept gpu arch version 6.1.使用 GTX 1080,所以我只保留了 gpu 拱版 6.1。 Omitting other versions cut build time from 2hr15min to ~30min:省略其他版本将构建时间从 2 小时 15 分钟缩短到约 30 分钟:

Pascal (CUDA 8 and later)
SM60 or SM_60, compute_60 – Quadro GP100, Tesla P100, DGX-1 (Generic Pascal)
SM61 or SM_61, compute_61 – GTX 1080, GTX 1070, GTX

Full Build Specs from CMake: CMake 的完整构建规格:

Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
Detected processor: AMD64
libjpeg-turbo: VERSION = 2.0.4, BUILD = opencv-4.3.0-dev-libjpeg-turbo
Found OpenJPEG: openjp2 (found version "2.3.0")
found Intel IPP (ICV version): 2020.0.0 [2020.0.0 Gold]
at: C:/Users/---/Downloads/opencv-master/build/3rdparty/ippicv/ippicv_win/icv
found Intel IPP Integration Wrappers sources: 2020.0.0
at: C:/Users/---/Downloads/opencv-master/build/3rdparty/ippicv/ippicv_win/iw
CUDA detected: 10.0
CUDA NVCC target flags: -gencode;arch=compute_61,code=sm_61;-D_FORCE_INLINES
Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 
VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
OpenCV Python: during development append to PYTHONPATH: C:/Users/---/Downloads/opencv-master/build/python_loader
Module opencv_alphamat disabled because the following dependencies are not found: Eigen
Caffe: NO
Protobuf: NO
Glog: NO
freetype2: NO
harfbuzz: NO
Module opencv_ovis disabled because OGRE3D was not found
No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.
Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.
Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags
Tesseract: NO
Allocator metrics storage type: 'long long'
Registering hook 'INIT_MODULE_SOURCES_opencv_dnn': C:/Users/---/Downloads/opencv-master/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake
CMake Warning at cmake/OpenCVGenSetupVars.cmake:54 (message):
CONFIGURATION IS NOT SUPPORTED: validate setupvars script in install
directory
Call Stack (most recent call first):
CMakeLists.txt:967 (include)

General configuration for OpenCV 4.3.0-dev =====================================
Version control: unknown

Extra modules:
Location (extra): C:/Users/---/Downloads/opencv_contrib-master/modules
Version control (extra): unknown

Platform:
Timestamp: 2020-04-27T18:31:30Z
Host: Windows 10.0.18363 AMD64
CMake: 3.17.1
CMake generator: Visual Studio 15 2017
CMake build tool: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/Bin/MSBuild.exe
MSVC: 1916

CPU/HW features:
Baseline: SSE SSE2 SSE3
requested: SSE3
Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
SSE4_1 (16 files): + SSSE3 SSE4_1
SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2
FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
AVX (5 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
AVX2 (30 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
AVX512_SKX (6 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX

C/C++:
Built as dynamic libs?: YES
C++ standard: 11
C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe (ver 19.16.27039.0)
C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP /MD /O2 /Ob2 /DNDEBUG 
C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP /MDd /Zi /Ob0 /Od /RTC1 
C Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /MP /MD /O2 /Ob2 /DNDEBUG 
C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /MP /MDd /Zi /Ob0 /Od /RTC1 
Linker flags (Release): /machine:x64 /INCREMENTAL:NO 
Linker flags (Debug): /machine:x64 /debug /INCREMENTAL 
ccache: NO
Precompiled headers: YES
Extra dependencies: cudart_static.lib nppc.lib nppial.lib nppicc.lib nppicom.lib nppidei.lib nppif.lib nppig.lib nppim.lib nppist.lib nppisu.lib nppitc.lib npps.lib cublas.lib cudnn.lib cufft.lib -LIBPATH:C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/lib/x64 -LIBPATH:C:/Users/---/Downloads/cudnn-10.0-windows10-x64-v7.6.5.32/cuda/lib/x64
3rdparty dependencies:

OpenCV modules:
To be built: aruco bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy gapi hdf hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor ml objdetect optflow phase_unwrapping photo plot python3 pythoncuda quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
Disabled: world  (i have this enabled in another attempt- and included it in env path)
Disabled by dependency: -
Unavailable: alphamat cnn_3dobj cvv freetype java js matlab ovis python2 sfm viz
Applications: tests perf_tests apps
Documentation: NO
Non-free algorithms: NO

Windows RT support: NO

GUI: 
Win32 UI: YES
VTK support: NO

Media I/O: 
ZLib: build (ver 1.2.11)
JPEG: build-libjpeg-turbo (ver 2.0.4-62)
WEBP: build (ver encoder: 0x020f)
PNG: build (ver 1.6.37)
TIFF: build (ver 42 - 4.0.10)
JPEG 2000: OpenJPEG (ver 2.3.0)
OpenEXR: build (ver 2.3.0)
HDR: YES
SUNRASTER: YES
PXM: YES
PFM: YES

Video I/O:
DC1394: NO
FFMPEG: YES (prebuilt binaries)
avcodec: YES (58.54.100)
avformat: YES (58.29.100)
avutil: YES (56.31.100)
swscale: YES (5.5.100)
avresample: YES (4.0.0)
GStreamer: NO
DirectShow: YES
Media Foundation: YES
DXVA: YES

Parallel framework: Concurrency

Trace: YES (with Intel ITT)

Other third-party libraries:
Intel IPP: 2020.0.0 Gold [2020.0.0]
at: C:/Users/---/Downloads/opencv-master/build/3rdparty/ippicv/ippicv_win/icv
Intel IPP IW: sources (2020.0.0)
at: C:/Users/---/Downloads/opencv-master/build/3rdparty/ippicv/ippicv_win/iw
Eigen: NO
Custom HAL: NO
Protobuf: build (3.5.1)

NVIDIA CUDA: YES (ver 10.0, CUFFT CUBLAS FAST_MATH)
NVIDIA GPU arch: 61
NVIDIA PTX archs:

cuDNN: YES (ver 7.6.5)

OpenCL: YES (NVD3D11)
Include path: C:/Users/---/Downloads/opencv-master/3rdparty/include/opencl/1.2
Link libraries: Dynamic load

Python 3:
Interpreter: C:/ProgramData/Anaconda3/python.exe (ver 3.7.7)
Libraries: C:/ProgramData/Anaconda3/libs/python37.lib (ver 3.7.7)
numpy: C:/ProgramData/Anaconda3/Lib/site-packages/numpy/core/include (ver 1.15.0)
install path: C:/ProgramData/Anaconda3/Lib/site-packages/cv2/python-3.7

Python (for build): C:/ProgramData/Anaconda3/python.exe

Java: 
ant: NO
JNI: NO
Java wrappers: NO
Java tests: NO

Install to: C:/Users/---/Downloads/opencv-master/build/install
-----------------------------------------------------------------

Configuring done

Am I missing something?我错过了什么吗? Help!帮助!

edit: These messages now pop up after Visual Studio Build编辑:这些消息现在在 Visual Studio Build 之后弹出

edit2: Now getting this on INSTALL build: C:\Users---\Downloads\opencv-master\build\modules\highgui\opencv_highgui.vcxproj: error: The project file could not be loaded.编辑2:现在在安装版本中得到这个:C:\Users---\Downloads\opencv-master\build\modules\highgui\opencv_highgui.vcxproj:错误:无法加载项目文件。 Data at the root level is invalid.根级别的数据无效。 Line 260, position 11. C:\Users---\Downloads\opencv-master\build\modules\highgui\opencv_highgui.vcxproj第 260 行,position 11. C:\Users---\Downloads\opencv-master\build\modules\highgui\opencv_highgui.vcxproj

edit3: I deleted and unzipped opencv-master to start fresh, again, and now on CMake Configure I get:编辑3:我删除并解压缩了opencv-master以重新开始,现在在CMake上配置我得到:

CMake Error at modules/videoio/cmake/detect_ffmpeg.cmake:16 (include):
include could not find load file:

C:/Users/---/Downloads/opencv-master/build/3rdparty/ffmpeg/ffmpeg_version.cmake
Call Stack (most recent call first):
modules/videoio/cmake/init.cmake:3 (include)
modules/videoio/cmake/init.cmake:22 (add_backend)
cmake/OpenCVModule.cmake:312 (include)
cmake/OpenCVModule.cmake:375 (_add_modules_1)
modules/CMakeLists.txt:7 (ocv_glob_modules)

CMake Warning at C:/Users/---/Downloads/opencv-master/cmake/OpenCVModule.cmake:679 (message):
Unexpected include:
C:/Users/---/Downloads/opencv-master/build/downloads/xfeatures2d
(module=opencv_xfeatures2d)
Call Stack (most recent call first):
C:/Users/---/Downloads/opencv-master/cmake/OpenCVModule.cmake:710 (ocv_target_include_modules)
C:/Users/---/Downloads/opencv_contrib-master/modules/xfeatures2d/CMakeLists.txt:17 (ocv_module_include_directories)
CMake Warning at cmake/OpenCVGenSetupVars.cmake:54 (message):
CONFIGURATION IS NOT SUPPORTED: validate setupvars script in install
directory
Call Stack (most recent call first):
CMakeLists.txt:967 (include)

edit4: Deleted opencv-master/opencv-contrib-master and reran CMake. edit4:删除了 opencv-master/opencv-contrib-master 并重新运行了 CMake。 I noticed this warning when I first configure CMake.当我第一次配置 CMake 时,我注意到了这个警告。 Might be related to config error above...?可能与上面的配置错误有关...?

CMake Warning at cmake/OpenCVDetectPython.cmake:81 (message):
  CMake's 'find_host_package(PythonInterp 2.7)' found wrong Python version:

  PYTHON_EXECUTABLE=C:/ProgramData/Anaconda3/python.exe

  PYTHON_VERSION_STRING=3.7.7

  Consider providing the 'PYTHON2_EXECUTABLE' variable via CMake command line
  or environment variables

Call Stack (most recent call first):
  cmake/OpenCVDetectPython.cmake:271 (find_python)
  CMakeLists.txt:598 (include)

Edit 5: Visual Studio output:编辑 5:Visual Studio output:

CMake Error at modules/python3/cmake_install.cmake:93 (file):
197>  file INSTALL cannot find
197>  "C:/Users/---/Documents/opencv_folder/opencv-master/opencv-master/build/lib/python3/Release/cv2.cp37-win_amd64.pyd":
197>  File exists.
197>Call Stack (most recent call first):
197>  modules/cmake_install.cmake:192 (include)
197>  cmake_install.cmake:120 (include)

From anaconda CLI:从 anaconda CLI:

>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Anaconda3\lib\cv2\__init__.py", line 96, in <module>
    bootstrap()
  File "C:\ProgramData\Anaconda3\lib\cv2\__init__.py", line 62, in bootstrap
    ], True)
  File "C:\ProgramData\Anaconda3\lib\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.

Edit 6: Visual Studio Completed a build (againx8) with no errors.编辑 6:Visual Studio 完成了构建(再次为 x8),没有错误。

>>> import cv2
['', 'C:\\ProgramData\\Anaconda3\\python.exe', 'C:\\ProgramData\\Anaconda3\\python37.zip', 'C:\\ProgramData\\Anaconda3\\DLLs', 'C:\\ProgramData\\Anaconda3\\lib', 'C:\\ProgramData\\Anaconda3', 'C:\\Users\\---\\AppData\\Roaming\\Python\\Python37\\site-packages', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\win32', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\win32\\lib', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\Pythonwin']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Anaconda3\lib\cv2\__init__.py", line 96, in <module>
    bootstrap()
  File "C:\ProgramData\Anaconda3\lib\cv2\__init__.py", line 23, in bootstrap
    raise ImportError('ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.')
ImportError: ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.

Deleting cv2 from "C:\ProgramData\Anaconda3\Lib" creates module not found error.从“C:\ProgramData\Anaconda3\Lib”中删除 cv2 会创建找不到模块错误。 Deleting cv2 from "C:\ProgramData\Anaconda3\Lib\Site-Packages" creates dll error.从“C:\ProgramData\Anaconda3\Lib\Site-Packages”中删除 cv2 会产生 dll 错误。 Deleting both slightly increases the number of hours I've spent on this setup.删除两者都会稍微增加我在此设置上花费的小时数。

I compiled with cv2world enabled and disabled and set cv2world.dll in env path and copied to ProgramData\Anaconda\Lib.我在启用和禁用 cv2world 的情况下进行编译,并在 env 路径中设置 cv2world.dll 并复制到 ProgramData\Anaconda\Lib。

Edit 7: All of my once partitioned R environments are broken and my computer now runs quite poorly (explorer gets stuck on 99% when transferring files regardless of size; significantly increased boot times).编辑 7:我曾经分区的所有 R 环境都已损坏,我的计算机现在运行非常糟糕(无论大小如何,在传输文件时,Explorer 都会卡在 99%;显着增加了启动时间)。 There is now an errant Python3.6 installation.现在有一个错误的 Python3.6 安装。 It might be time to reinstall windows.可能是时候重新安装 windows。

Edit 8:编辑8:

import cv2
Traceback (most recent call last):

  File "<ipython-input-1-c8ec22b3e787>", line 1, in <module>
    import cv2

  File "C:\Users\Arman\AppData\Roaming\Python\Python37\site-packages\cv2\__init__.py", line 89, in <module>
    bootstrap()

  File "C:\Users\Arman\AppData\Roaming\Python\Python37\site-packages\cv2\__init__.py", line 62, in bootstrap
    ], True)

  File "C:\Users\Arman\AppData\Roaming\Python\Python37\site-packages\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.

I tried ctrl+cv the config files but that changed error to one of recursion.我尝试了 ctrl+cv 配置文件,但将错误更改为递归之一。 No working opencv with cuda as of yet.到目前为止还没有工作 opencv 和 cuda。

Edit 9: Still no module being exported to Anaconda library.编辑 9:仍然没有模块被导出到 Anaconda 库。

Maybe it is related to this: Opencv fatal error LNK1120: 143 unresolved externals也许与此有关:Opencv 致命错误 LNK1120: 143 unresolved externals

opencv-folder\opencv-master\build\bin\Release\opencv_world430.dll : fatal error LNK1120: 143 unresolved externals
25>Done building project "opencv_world.vcxproj" -- FAILED.
26>------ Build started: Project: opencv_ts, Configuration: Release x64 ------
27>------ Build started: Project: opencv_img_hash, Configuration: Release x64 ------
28>------ Build started: Project: opencv_waldboost_detector, Configuration: Release x64 ------
29>------ Build started: Project: opencv_annotation, Configuration: Release x64 ------
30>------ Build started: Project: opencv_interactive-calibration, Configuration: Release x64 ------
31>------ Build started: Project: opencv_version, Configuration: Release x64 ------
32>------ Build started: Project: opencv_version_win32, Configuration: Release x64 ------
33>------ Build started: Project: opencv_visualisation, Configuration: Release x64 ------

Edit nsomething: From module not found to recursion detected:编辑 nsomething:从找不到模块到检测到递归:

(base) C:\Users\---\Documents\SystemConfig\opencv-folder\opencv-master\build\python_loader>python setup.py build
running build
running build_py

(base) C:\Users\---\Documents\SystemConfig\opencv-folder\opencv-master\build\python_loader>python setup.py install
running install
running bdist_egg
running egg_info
writing opencv.egg-info\PKG-INFO
writing dependency_links to opencv.egg-info\dependency_links.txt
writing requirements to opencv.egg-info\requires.txt
writing top-level names to opencv.egg-info\top_level.txt
reading manifest file 'opencv.egg-info\SOURCES.txt'
writing manifest file 'opencv.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\cv2
copying build\lib\cv2\config-2.7.py -> build\bdist.win-amd64\egg\cv2
copying build\lib\cv2\config-3.7.py -> build\bdist.win-amd64\egg\cv2
copying build\lib\cv2\config.py -> build\bdist.win-amd64\egg\cv2
copying build\lib\cv2\load_config_py2.py -> build\bdist.win-amd64\egg\cv2
copying build\lib\cv2\load_config_py3.py -> build\bdist.win-amd64\egg\cv2
copying build\lib\cv2\__init__.py -> build\bdist.win-amd64\egg\cv2
byte-compiling build\bdist.win-amd64\egg\cv2\config-2.7.py to config-2.7.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\cv2\config-3.7.py to config-3.7.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\cv2\config.py to config.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\cv2\load_config_py2.py to load_config_py2.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\cv2\load_config_py3.py to load_config_py3.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\cv2\__init__.py to __init__.cpython-37.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying opencv.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying opencv.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying opencv.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying opencv.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying opencv.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
zip_safe flag not set; analyzing archive contents...
cv2.__pycache__.__init__.cpython-37: module references __file__
creating 'dist\opencv-4.3.0-py3.7.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing opencv-4.3.0-py3.7.egg
removing 'a:\programdata\anaconda3\lib\site-packages\opencv-4.3.0-py3.7.egg' (and everything under it)
creating a:\programdata\anaconda3\lib\site-packages\opencv-4.3.0-py3.7.egg
Extracting opencv-4.3.0-py3.7.egg to a:\programdata\anaconda3\lib\site-packages
opencv 4.3.0 is already the active version in easy-install.pth

Installed a:\programdata\anaconda3\lib\site-packages\opencv-4.3.0-py3.7.egg
Processing dependencies for opencv==4.3.0
Searching for numpy==1.18.1
Best match: numpy 1.18.1
Adding numpy 1.18.1 to easy-install.pth file
Installing f2py-script.py script to A:\ProgramData\Anaconda3\Scripts
Installing f2py.exe script to A:\ProgramData\Anaconda3\Scripts

Using a:\programdata\anaconda3\lib\site-packages
Finished processing dependencies for opencv==4.3.0

(base) C:\Users\---\Documents\SystemConfig\opencv-folder\opencv-master\build\python_loader>

In the OpenCV forum thread OpenCV build for Windows x64/Python3.7 from source.在 OpenCV 论坛主题OpenCV 为 Windows x64/Python3.7 构建源代码。 Where is the.pyd file? .pyd 文件在哪里? , there is a comment (by KTeddy, I believe) that solved it for me: ,有一条评论(我相信是KTeddy)为我解决了这个问题:

If your python interpreter is not official, you can try the official version.如果你的 python 解释器不是官方的,你可以试试官方版本。 Details: I have used anaconda python to build opencv, but the same as your question, there isn't BUILD_opencv_python3 in cmake gui, as a result I can't get a.pyd file. Details: I have used anaconda python to build opencv, but the same as your question, there isn't BUILD_opencv_python3 in cmake gui, as a result I can't get a.pyd file. I come across a comment that anaconda and cmake have compatibility problems.我看到一条评论说 anaconda 和 cmake 存在兼容性问题。 Finally I solved it by installing official python version.最后我通过安装官方 python 版本解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM