zivid / zivid-python

Official Python package for Zivid 3D cameras
BSD 3-Clause "New" or "Revised" License
40 stars 14 forks source link

Installation fails: Unable to find 'eigen/3.3.7@conan/stable' #139

Closed erikschuitema closed 3 years ago

erikschuitema commented 3 years ago

Installation fails (Ubuntu 20.04.3; Python 3.8.10; zivid-python 2.1.2.2.4.1) with the following output:

$ pip3 install zivid
Collecting zivid
  Using cached zivid-2.1.2.2.4.1.tar.gz (46 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from zivid) (1.17.4)
Building wheels for collected packages: zivid
  Building wheel for zivid (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /tmp/tmp2n3cqje2 build_wheel /tmp/tmpu9jm5ope
       cwd: /tmp/pip-install-j_4xdno5/zivid
  Complete output (112 lines):
  cmake version 3.21.2

  CMake suite maintained and supported by Kitware (kitware.com/cmake).
  -- The CXX compiler identification is GNU 9.3.0
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /tmp/zivid-python-build-kzm8f1_p
  [1/2] Building CXX object CMakeFiles/lib.dir/lib.cpp.o
  [2/2] Linking CXX static library liblib.a
  Not searching for unused variables given on the command line.
  -- The C compiler identification is GNU 9.3.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- The CXX compiler identification is GNU 9.3.0
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /tmp/pip-install-j_4xdno5/zivid/_cmake_test_compile/build
  -- The CXX compiler identification is GNU 9.3.0
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Downloading conan.cmake from https://github.com/conan-io/cmake-conan
  -- Found Python3: /usr/bin/python3.8 (found suitable exact version "3.8.10") found components: Interpreter Development.Module
  -- Conan: Automatic detection of conan settings from cmake
  -- Conan: Settings= -s;build_type=Release;-s;compiler=gcc;-s;compiler.version=9;-s;compiler.libcxx=libstdc++11
  -- Conan: checking conan executable
  -- Conan: Found program /tmp/pip-build-env-xyimx1gk/overlay/bin/conan
  -- Conan: Version found Conan version 1.40.0

  -- Conan executing: /tmp/pip-build-env-xyimx1gk/overlay/bin/conan install . -s build_type=Release -s compiler=gcc -s compiler.version=9 -s compiler.libcxx=libstdc++11 -g=cmake
  Configuration:
  [settings]
  arch=x86_64
  arch_build=x86_64
  build_type=Release
  compiler=gcc
  compiler.libcxx=libstdc++11
  compiler.version=9
  os=Linux
  os_build=Linux
  [options]
  [build_requires]
  [env]

  eigen/3.3.7@conan/stable: Not found in local cache, looking in remotes...
  eigen/3.3.7@conan/stable: Trying with 'conancenter'...
  ERROR: Unable to find 'eigen/3.3.7@conan/stable' in remotes
  CMake Error at _skbuild/linux-x86_64-3.8/cmake-build/conan.cmake:522 (message):
    Conan install failed='1'
  Call Stack (most recent call first):
    _skbuild/linux-x86_64-3.8/cmake-build/conan.cmake:759 (old_conan_cmake_install)
    CMakeLists.txt:13 (conan_cmake_run)

  -- Configuring incomplete, errors occurred!
  See also "/tmp/pip-install-j_4xdno5/zivid/_skbuild/linux-x86_64-3.8/cmake-build/CMakeFiles/CMakeOutput.log".
    File "/tmp/pip-build-env-xyimx1gk/overlay/lib/python3.8/site-packages/skbuild/setuptools_wrap.py", line 586, in setup
      env = cmkr.configure(cmake_args,
    File "/tmp/pip-build-env-xyimx1gk/overlay/lib/python3.8/site-packages/skbuild/cmaker.py", line 237, in configure
      raise SKBuildError(

  --------------------------------------------------------------------------------
  -- Trying "Ninja" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Ninja" generator - success
  --------------------------------------------------------------------------------

  Configuring Project
    Working directory:
      /tmp/pip-install-j_4xdno5/zivid/_skbuild/linux-x86_64-3.8/cmake-build
    Command:
      cmake /tmp/pip-install-j_4xdno5/zivid -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-install-j_4xdno5/zivid/_skbuild/linux-x86_64-3.8/cmake-install -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -DPYTHON_VERSION_STRING:STRING=3.8.10 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 -DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/tmp/pip-build-env-xyimx1gk/overlay/lib/python3.8/site-packages/skbuild/resources/cmake -DZIVID_PYTHON_VERSION=2.1.2.2.4.1 -DZIVID_SDK_VERSION=2.4.1 -DPYTHON_INTERPRETER_VERSION=3.8.10 -DCMAKE_BUILD_TYPE:STRING=Release

  Traceback (most recent call last):

  An error occurred while configuring with CMake.
    Command:
      cmake /tmp/pip-install-j_4xdno5/zivid -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-install-j_4xdno5/zivid/_skbuild/linux-x86_64-3.8/cmake-install -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -DPYTHON_VERSION_STRING:STRING=3.8.10 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 -DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/tmp/pip-build-env-xyimx1gk/overlay/lib/python3.8/site-packages/skbuild/resources/cmake -DZIVID_PYTHON_VERSION=2.1.2.2.4.1 -DZIVID_SDK_VERSION=2.4.1 -DPYTHON_INTERPRETER_VERSION=3.8.10 -DCMAKE_BUILD_TYPE:STRING=Release
    Source directory:
      /tmp/pip-install-j_4xdno5/zivid
    Working directory:
      /tmp/pip-install-j_4xdno5/zivid/_skbuild/linux-x86_64-3.8/cmake-build
  Please see CMake's output for more information.
  ----------------------------------------
  ERROR: Failed building wheel for zivid
Failed to build zivid
ERROR: Could not build wheels for zivid which use PEP 517 and cannot be installed directly

The following changes seem to fix the build/install, but I don't know if there are side effects:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b2d8685..10038af 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,7 @@ include(${CMAKE_BINARY_DIR}/conan.cmake)

 conan_cmake_run(
     REQUIRES
-        eigen/3.3.7@conan/stable
+        eigen/3.3.7
         pybind11/2.6.1
     CMAKE_TARGETS
     BASIC_SETUP)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dbb0fcd..d1cec0f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -44,7 +44,7 @@ target_link_libraries(${PROJECT_NAME}
     PRIVATE Zivid::Core
             Python3::Module
             CONAN_PKG::pybind11
-            CONAN_PKG::Eigen3
+            CONAN_PKG::eigen
 )

 install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION modules/${PROJECT_NAME})
trym-b commented 3 years ago

It seems like the repo providing eigen@conan/stable has been marked obsolete: https://github.com/conan-community/conan-eigen And the new repo can be found here: https://github.com/conan-io/conan-center-index Your fix seems to be correct, so thank you for providing it. Although we will likely bump the eigen version to 3.3.9 as it seems like that is the lastest version for the moment. Thank you for your help :)

erikschuitema commented 3 years ago

Thanks for solving this at the speed of light!