Unity-Technologies / datasetinsights

Synthetic Dataset Insights
Apache License 2.0
84 stars 16 forks source link

pip install fails on Python3.9/Windows 10 because of opencv-python version #174

Open leopoldo-zugasti opened 3 years ago

leopoldo-zugasti commented 3 years ago

Describe the Bug: pip install fails to compile opencv-python on windows 10 when using python3.9

How to Reproduce? On Windows 10 With Python3.9 (Using conda or not doesn't change anything) run pip install datasetinsights

What did you expect to happen: The package gets installed

Console logs / stack traces

FAILED: 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/util/internal/default_value_objectwriter.cc.obj
  C:\PROGRA~2\MICROS~2\2017\BUILDT~1\VC\Tools\MSVC\1416~1.270\bin\Hostx86\x64\cl.exe  /nologo /TP -D_CRT_SECURE_NO_WARNINGS=1 -D_VARIADIC_MAX=10 -D_WIN32_WINNT=0x0601 -I3rdparty\ippicv\ippicv_win\icv\include -I3rdparty\ippicv\ippicv_win\iw\include -I. -IC:\Users\leopoldo.zugasti\AppData\Local\Temp\pip-install-3wlcvnau\opencv-python_83d47fe27e8f47a8a847fa0488fee1d9\opencv\3rdparty\protobuf\src /DWIN32 /D_WINDOWS /W3 /GR  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:precise /FS     /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /wd4244 /wd4267 /wd4018 /wd4355 /wd4800 /wd4251 /wd4996 /wd4146 /wd4305 /wd4127 /wd4100 /wd4512 /wd4125 /wd4389 /wd4510 /wd4610 /wd4702 /wd4456 /wd4457 /wd4065 /wd4310 /wd4661 /wd4506 /wd4701 /wd4703 /wd4505  /MT /O2 /Ob2 /DNDEBUG /showIncludes /Fo3rdparty\protobuf\CMakeFiles\libprotobuf.dir\src\google\protobuf\util\internal\default_value_objectwriter.cc.obj /Fd3rdparty\lib\libprotobuf.pdb /FS -c C:\Users\leopoldo.zugasti\AppData\Local\Temp\pip-install-3wlcvnau\opencv-python_83d47fe27e8f47a8a847fa0488fee1d9\opencv\3rdparty\protobuf\src\google\protobuf\util\internal\default_value_objectwriter.cc
  C:\Users\leopoldo.zugasti\AppData\Local\Temp\pip-install-3wlcvnau\opencv-python_83d47fe27e8f47a8a847fa0488fee1d9\opencv\3rdparty\protobuf\src\google\protobuf\util\internal\default_value_objectwriter.cc : fatal error C1083: Cannot open compiler generated file: '': Invalid argument
  [473/1061] Building CXX object 3rdparty\protobuf\CMakeFiles\libprotobuf.dir\src\google\protobuf\util\internal\field_mask_utility.cc.obj
  [474/1061] Building CXX object 3rdparty\protobuf\CMakeFiles\libprotobuf.dir\src\google\protobuf\util\internal\object_writer.cc.obj
  [475/1061] Building CXX object 3rdparty\protobuf\CMakeFiles\libprotobuf.dir\src\google\protobuf\util\field_comparator.cc.obj
  [476/1061] Building CXX object 3rdparty\protobuf\CMakeFiles\libprotobuf.dir\src\google\protobuf\util\field_mask_util.cc.obj
  [477/1061] Building CXX object 3rdparty\protobuf\CMakeFiles\libprotobuf.dir\src\google\protobuf\util\internal\json_objectwriter.cc.obj
  [478/1061] Building CXX object 3rdparty\protobuf\CMakeFiles\libprotobuf.dir\src\google\protobuf\struct.pb.cc.obj
  [479/1061] Building CXX object 3rdparty\protobuf\CMakeFiles\libprotobuf.dir\src\google\protobuf\util\internal\json_stream_parser.cc.obj
  [480/1061] Building CXX object 3rdparty\protobuf\CMakeFiles\libprotobuf.dir\src\google\protobuf\text_format.cc.obj
  [481/1061] Building CXX object 3rdparty\protobuf\CMakeFiles\libprotobuf.dir\src\google\protobuf\util\internal\datapiece.cc.obj
  [482/1061] Building CXX object 3rdparty\protobuf\CMakeFiles\libprotobuf.dir\src\google\protobuf\util\internal\type_info.cc.obj
  [483/1061] Building CXX object 3rdparty\protobuf\CMakeFiles\libprotobuf.dir\src\google\protobuf\util\internal\proto_writer.cc.obj
  [484/1061] Building CXX object 3rdparty\protobuf\CMakeFiles\libprotobuf.dir\src\google\protobuf\descriptor.cc.obj
  [485/1061] Building CXX object 3rdparty\protobuf\CMakeFiles\libprotobuf.dir\src\google\protobuf\util\internal\protostream_objectwriter.cc.obj
  ninja: build stopped: subcommand failed.
    File "C:\Users\leopoldo.zugasti\AppData\Local\Temp\pip-build-env-_sv9pk33\overlay\Lib\site-packages\skbuild\setuptools_wrap.py", line 589, in setup
      cmkr.make(make_args, env=env)
    File "C:\Users\leopoldo.zugasti\AppData\Local\Temp\pip-build-env-_sv9pk33\overlay\Lib\site-packages\skbuild\cmaker.py", line 496, in make
      raise SKBuildError(

  --------------------------------------------------------------------------------
  -- Trying "Ninja (Visual Studio 15 2017 Win64 v141)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Ninja (Visual Studio 15 2017 Win64 v141)" generator - success
  --------------------------------------------------------------------------------

  Configuring Project
    Working directory:
      C:\Users\leopoldo.zugasti\AppData\Local\Temp\pip-install-3wlcvnau\opencv-python_83d47fe27e8f47a8a847fa0488fee1d9\_skbuild\win-amd64-3.9\cmake-build
    Command:
      cmake 'C:\Users\leopoldo.zugasti\AppData\Local\Temp\pip-install-3wlcvnau\opencv-python_83d47fe27e8f47a8a847fa0488fee1d9\opencv' -G Ninja '-DCMAKE_INSTALL_PREFIX:PATH=C:\Users\leopoldo.zugasti\AppData\Local\Temp\pip-install-3wlcvnau\opencv-python_83d47fe27e8f47a8a847fa0488fee1d9\_skbuild\win-amd64-3.9\cmake-install' '-DPYTHON_EXECUTABLE:FILEPATH=C:\Users\leopoldo.zugasti\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' -DPYTHON_VERSION_STRING:STRING=3.9.6 '-DPYTHON_INCLUDE_DIR:PATH=C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1776.0_x64__qbz5n2kfra8p0\Include' '-DPYTHON_LIBRARY:FILEPATH=C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1776.0_x64__qbz5n2kfra8p0\libs\python39.lib' -DSKBUILD:BOOL=TRUE '-DCMAKE_MODULE_PATH:PATH=C:\Users\leopoldo.zugasti\AppData\Local\Temp\pip-build-env-_sv9pk33\overlay\Lib\site-packages\skbuild\resources\cmake' '-DPYTHON3_EXECUTABLE=C:\Users\leopoldo.zugasti\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' '-DPYTHON3_INCLUDE_DIR=C:/Program Files/WindowsApps/PythonSoftwareFoundation.Python.3.9_3.9.1776.0_x64__qbz5n2kfra8p0/Include' '-DPYTHON3_LIBRARY=C:/Program Files/WindowsApps/PythonSoftwareFoundation.Python.3.9_3.9.1776.0_x64__qbz5n2kfra8p0/libs/python39.lib' -DBUILD_opencv_python3=ON -DBUILD_opencv_python2=OFF -DBUILD_opencv_java=OFF -DOPENCV_SKIP_PYTHON_LOADER=ON -DOPENCV_PYTHON3_INSTALL_PATH=python -DINSTALL_CREATE_DISTRIB=ON -DBUILD_opencv_apps=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_DOCS=OFF -DCMAKE_BUILD_TYPE:STRING=Release

  Traceback (most recent call last):

  An error occurred while building with CMake.
    Command:
      cmake --build . --target install --config Release --
    Source directory:
      C:\Users\leopoldo.zugasti\AppData\Local\Temp\pip-install-3wlcvnau\opencv-python_83d47fe27e8f47a8a847fa0488fee1d9
    Working directory:
      C:\Users\leopoldo.zugasti\AppData\Local\Temp\pip-install-3wlcvnau\opencv-python_83d47fe27e8f47a8a847fa0488fee1d9\_skbuild\win-amd64-3.9\cmake-build
  Please see CMake's output for more information.
  ----------------------------------------
  ERROR: Failed building wheel for opencv-python
Failed to build opencv-python
ERROR: Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly

Anything else you would like to add: The solution would be to bump the opencv version from 4.4.0.44 to 4.5.2.54

Environment: