简体   繁体   中英

Python OpenCv build is not detecting visual studio 2019 in command line

When i try to build the opencv package in python using command line

PS C:\Program Files\Open_CV\opencv-python> python setup.py build

It throws an error:
Version: 4.3.0+3073e9e setup.py:85: DeprecationWarning: SO is deprecated, use EXT_SUFFIX
['python/cv2[^/]*%(ext)s' % {'ext': re.escape(sysconfig.get_config_var('SO'))}],
Trying "Visual Studio 14 Win64" generator
Not searching for unused variables given on the command line.
Selecting Windows SDK version to target Windows 10.0.18363.
CMake Error at CMakeLists.txt:2 (PROJECT):
Failed to run MSBuild command:

MSBuild.exe
to get the value of VCTargetsPath:

The system cannot find the file specified
Configuring incomplete, errors occurred: See also "C./Program Files/Open_CV/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".

Trying "Visual Studio 14 Win64" generator - failure scikit-build could not get a working generator for your system. Aborting build.

Building windows wheels for Python 3.8 requires Microsoft Visual Studio 2017. Get it with "Visual Studio 2017":

https://visualstudio.microsoft.com/vs/

They don't automatically detect VS2019 yet. You have to specify the generator.

python setup.py build -G "Visual Studio 16 2019"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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