tcsantini / eyerec-python

14 stars 1 forks source link

Problems with installation #1

Closed jakeck1 closed 3 years ago

jakeck1 commented 3 years ago

System information Linux Ubuntu 16.04.7 Python Version 3.8.6 (using pyenv) , (also did not work on 3.5)

Problem When installing via

pip install .

I get the error message below. Do you have any idea what might be the problem here?

  ERROR: Command errored out with exit status 1:
   command: /home/student/j/jakeck/.pyenv/versions/3.8.6/envs/myenv/bin/python3.8 /home/student/j/jakeck/.pyenv/versions/3.8.6/envs/myenv/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmphnycvjmi
       cwd: /tmp/pip-req-build-kowdgpar
  Complete output (159 lines):
  Not searching for unused variables given on the command line.
  -- The C compiler identification is GNU 5.4.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 5.4.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-req-build-kowdgpar/_cmake_test_compile/build
  -- The C compiler identification is GNU 5.4.0
  -- The CXX compiler identification is GNU 5.4.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
  -- 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
  -- Found PythonInterp: /home/student/j/jakeck/.pyenv/versions/3.8.6/envs/myenv/bin/python3.8 (found version "3.8.6")
  -- Found Cython: /tmp/pip-build-env-7gutuw21/overlay/bin/cython
  -- Found PythonLibs: /home/student/j/jakeck/.pyenv/versions/3.8.6/lib/libpython3.8.a (found version "3.8.6")
  -- Found NumPy: /usr/include (found version "1.19.2")
  -- Performing Test Weak Link MODULE -> SHARED (gnu_ld_ignore) - Success
  _modinit_prefix:PyInit_
  -- Configuring done
  -- Generating done
  CMake Warning:
    Manually-specified variables were not used by the project:

      SKBUILD

  -- Build files have been written to: /tmp/pip-req-build-kowdgpar/_skbuild/linux-x86_64-3.8/cmake-build
  [1/10] Building CXX object lib/cpp/CMakeFiles/eyerec.dir/src/pupil/tracking/PupilTrackingMethod.cpp.o
  FAILED: lib/cpp/CMakeFiles/eyerec.dir/src/pupil/tracking/PupilTrackingMethod.cpp.o
  /usr/bin/c++  -I/usr/include/opencv -I../../../lib/cpp/include -I../../../lib/cpp/src -O3 -DNDEBUG -MD -MT lib/cpp/CMakeFiles/eyerec.dir/src/pupil/tracking/PupilTrackingMethod.cpp.o -MF lib/cpp/CMakeFiles/eyerec.dir/src/pupil/tracking/PupilTrackingMethod.cpp.o.d -o lib/cpp/CMakeFiles/eyerec.dir/src/pupil/tracking/PupilTrackingMethod.cpp.o -c ../../../lib/cpp/src/pupil/tracking/PupilTrackingMethod.cpp
  In file included from ../../../lib/cpp/src/pupil/tracking/PupilTrackingMethod.cpp:1:0:
  ../../../lib/cpp/include/eyerec/PupilTrackingMethod.hpp:9:28: fatal error: opencv2/core.hpp: No such file or directory
  compilation terminated.
  [2/10] Building CXX object lib/cpp/CMakeFiles/eyerec.dir/src/pupil/tracking/PuReST/PuReST.cpp.o
  FAILED: lib/cpp/CMakeFiles/eyerec.dir/src/pupil/tracking/PuReST/PuReST.cpp.o
  /usr/bin/c++  -I/usr/include/opencv -I../../../lib/cpp/include -I../../../lib/cpp/src -O3 -DNDEBUG -MD -MT lib/cpp/CMakeFiles/eyerec.dir/src/pupil/tracking/PuReST/PuReST.cpp.o -MF lib/cpp/CMakeFiles/eyerec.dir/src/pupil/tracking/PuReST/PuReST.cpp.o.d -o lib/cpp/CMakeFiles/eyerec.dir/src/pupil/tracking/PuReST/PuReST.cpp.o -c ../../../lib/cpp/src/pupil/tracking/PuReST/PuReST.cpp
  In file included from /usr/include/c++/5/random:35:0,
                   from ../../../lib/cpp/include/eyerec/PuRe.hpp:5,
                   from ../../../lib/cpp/include/eyerec/PuReST.hpp:4,
                   from ../../../lib/cpp/src/pupil/tracking/PuReST/PuReST.cpp:45:
  /usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
   #error This file requires compiler and library support \
    ^
  In file included from ../../../lib/cpp/include/eyerec/PuReST.hpp:4:0,
                   from ../../../lib/cpp/src/pupil/tracking/PuReST/PuReST.cpp:45:
  ../../../lib/cpp/include/eyerec/PuRe.hpp:7:31: fatal error: opencv2/highgui.hpp: No such file or directory
  compilation terminated.
  [3/10] Building CXX object lib/cpp/CMakeFiles/eyerec.dir/src/pupil/detection/PupilDetectionMethod.cpp.o
  FAILED: lib/cpp/CMakeFiles/eyerec.dir/src/pupil/detection/PupilDetectionMethod.cpp.o
  /usr/bin/c++  -I/usr/include/opencv -I../../../lib/cpp/include -I../../../lib/cpp/src -O3 -DNDEBUG -MD -MT lib/cpp/CMakeFiles/eyerec.dir/src/pupil/detection/PupilDetectionMethod.cpp.o -MF lib/cpp/CMakeFiles/eyerec.dir/src/pupil/detection/PupilDetectionMethod.cpp.o.d -o lib/cpp/CMakeFiles/eyerec.dir/src/pupil/detection/PupilDetectionMethod.cpp.o -c ../../../lib/cpp/src/pupil/detection/PupilDetectionMethod.cpp
  In file included from ../../../lib/cpp/src/pupil/detection/PupilDetectionMethod.cpp:1:0:
  ../../../lib/cpp/include/eyerec/PupilDetectionMethod.hpp:8:28: fatal error: opencv2/core.hpp: No such file or directory
  compilation terminated.
  [4/10] Building CXX object lib/cpp/CMakeFiles/eyerec.dir/src/pupil/detection/PuRe/PuRe.cpp.o
  FAILED: lib/cpp/CMakeFiles/eyerec.dir/src/pupil/detection/PuRe/PuRe.cpp.o
  /usr/bin/c++  -I/usr/include/opencv -I../../../lib/cpp/include -I../../../lib/cpp/src -O3 -DNDEBUG -MD -MT lib/cpp/CMakeFiles/eyerec.dir/src/pupil/detection/PuRe/PuRe.cpp.o -MF lib/cpp/CMakeFiles/eyerec.dir/src/pupil/detection/PuRe/PuRe.cpp.o.d -o lib/cpp/CMakeFiles/eyerec.dir/src/pupil/detection/PuRe/PuRe.cpp.o -c ../../../lib/cpp/src/pupil/detection/PuRe/PuRe.cpp
  ../../../lib/cpp/src/pupil/detection/PuRe/PuRe.cpp:5:31: fatal error: opencv2/highgui.hpp: No such file or directory
  compilation terminated.
  [5/10] Building CXX object lib/cpp/CMakeFiles/eyerec.dir/src/common/ocv_utils.cpp.o
  FAILED: lib/cpp/CMakeFiles/eyerec.dir/src/common/ocv_utils.cpp.o
  /usr/bin/c++  -I/usr/include/opencv -I../../../lib/cpp/include -I../../../lib/cpp/src -O3 -DNDEBUG -MD -MT lib/cpp/CMakeFiles/eyerec.dir/src/common/ocv_utils.cpp.o -MF lib/cpp/CMakeFiles/eyerec.dir/src/common/ocv_utils.cpp.o.d -o lib/cpp/CMakeFiles/eyerec.dir/src/common/ocv_utils.cpp.o -c ../../../lib/cpp/src/common/ocv_utils.cpp
  ../../../lib/cpp/src/common/ocv_utils.cpp: In function ‘void distFromPoints(const cv::RotatedRect&, std::vector<cv::Point_<int> >, std::vector<double>&)’:
  ../../../lib/cpp/src/common/ocv_utils.cpp:133:10: error: ‘axes’ does not name a type
       auto axes = std::minmax(ellipse.size.height, ellipse.size.height);
            ^
  ../../../lib/cpp/src/common/ocv_utils.cpp:134:10: error: ‘minor’ does not name a type
       auto minor = 0.5 * axes.first;
            ^
  ../../../lib/cpp/src/common/ocv_utils.cpp:135:10: error: ‘major’ does not name a type
       auto major = 0.5 * axes.second;
            ^
  ../../../lib/cpp/src/common/ocv_utils.cpp:137:31: error: ‘major’ was not declared in this scope
       cv::Matx22d rA(cos, sin, -major * sin / minor, major * cos / minor);
                                 ^
  ../../../lib/cpp/src/common/ocv_utils.cpp:137:45: error: ‘minor’ was not declared in this scope
       cv::Matx22d rA(cos, sin, -major * sin / minor, major * cos / minor);
                                               ^
  ../../../lib/cpp/src/common/ocv_utils.cpp:140:16: error: ISO C++ forbids declaration of ‘p’ with no type [-fpermissive]
       for (auto& p : points) {
                  ^
  ../../../lib/cpp/src/common/ocv_utils.cpp:140:20: warning: range-based ‘for’ loops only available with -std=c++11 or -std=gnu++11
       for (auto& p : points) {
                      ^
  ../../../lib/cpp/src/common/ocv_utils.cpp:141:18: error: ISO C++ forbids declaration of ‘rAxt’ with no type [-fpermissive]
           auto rAxt((rA(0, 0) * p.x + rA(0, 1) * p.y) - rAt(0));
                    ^
  ../../../lib/cpp/src/common/ocv_utils.cpp:141:33: error: request for member ‘x’ in ‘p’, which is of non-class type ‘int’
           auto rAxt((rA(0, 0) * p.x + rA(0, 1) * p.y) - rAt(0));
                                   ^
  ../../../lib/cpp/src/common/ocv_utils.cpp:141:50: error: request for member ‘y’ in ‘p’, which is of non-class type ‘int’
           auto rAxt((rA(0, 0) * p.x + rA(0, 1) * p.y) - rAt(0));
                                                    ^
  ../../../lib/cpp/src/common/ocv_utils.cpp:142:18: error: ISO C++ forbids declaration of ‘rAyt’ with no type [-fpermissive]
           auto rAyt((rA(1, 0) * p.x + rA(1, 1) * p.y) - rAt(1));
                    ^
  ../../../lib/cpp/src/common/ocv_utils.cpp:142:33: error: request for member ‘x’ in ‘p’, which is of non-class type ‘int’
           auto rAyt((rA(1, 0) * p.x + rA(1, 1) * p.y) - rAt(1));
                                   ^
  ../../../lib/cpp/src/common/ocv_utils.cpp:142:50: error: request for member ‘y’ in ‘p’, which is of non-class type ‘int’
           auto rAyt((rA(1, 0) * p.x + rA(1, 1) * p.y) - rAt(1));
                                                    ^
  ninja: build stopped: subcommand failed.
    File "/tmp/pip-build-env-7gutuw21/overlay/lib/python3.8/site-packages/skbuild/setuptools_wrap.py", line 589, in setup
      cmkr.make(make_args, env=env)
    File "/tmp/pip-build-env-7gutuw21/overlay/lib/python3.8/site-packages/skbuild/cmaker.py", line 496, in make
      raise SKBuildError(

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

  Configuring Project
    Working directory:
      /tmp/pip-req-build-kowdgpar/_skbuild/linux-x86_64-3.8/cmake-build
    Command:
      cmake /tmp/pip-req-build-kowdgpar -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-req-build-kowdgpar/_skbuild/linux-x86_64-3.8/cmake-install -DPYTHON_EXECUTABLE:FILEPATH=/home/student/j/jakeck/.pyenv/versions/3.8.6/envs/myenv/bin/python3.8 -DPYTHON_VERSION_STRING:STRING=3.8.6 -DPYTHON_INCLUDE_DIR:PATH=/home/student/j/jakeck/.pyenv/versions/3.8.6/include/python3.8 -DPYTHON_LIBRARY:FILEPATH=/home/student/j/jakeck/.pyenv/versions/3.8.6/lib/libpython3.8.a -DSKBUILD:BOOL=TRUE -DCMAKE_MODULE_PATH:PATH=/tmp/pip-build-env-7gutuw21/overlay/lib/python3.8/site-packages/skbuild/resources/cmake -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:
      /tmp/pip-req-build-kowdgpar
    Working directory:
      /tmp/pip-req-build-kowdgpar/_skbuild/linux-x86_64-3.8/cmake-build
  Please see CMake's output for more information.
  ----------------------------------------
  ERROR: Failed building wheel for eyerec
Failed to build eyerec
ERROR: Could not build wheels for eyerec which use PEP 517 and cannot be installed directly
tcsantini commented 3 years ago

/usr/bin/c++ -I/usr/include/opencv -I../../../lib/cpp/include -I../../../lib/cpp/src -O3 -DNDEBUG -MD -MT lib/cpp/CMakeFiles/eyerec.dir/src/pupil/tracking/PupilTrackingMethod.cpp.o -MF lib/cpp/CMakeFiles/eyerec.dir/src/pupil/tracking/PupilTrackingMethod.cpp.o.d -o lib/cpp/CMakeFiles/eyerec.dir/src/pupil/tracking/PupilTrackingMethod.cpp.o -c ../../../lib/cpp/src/pupil/tracking/PupilTrackingMethod.cpp

In file included from ../../../lib/cpp/src/pupil/tracking/PupilTrackingMethod.cpp:1:0: ../../../lib/cpp/include/eyerec/PupilTrackingMethod.hpp:9:28: fatal error: opencv2/core.hpp: No such file or #directory

Looks like an issue with your OpenCV installation. CMake is assuming its headers are installed at /usr/include/opencv, but the they are not found. Is that the correct path? If yes, which version are you using? 3.2.0 and above should be fine.

/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

It looks like you will need to set CMAKE_CXX_STANDARD to 11 or above as well.

jakeck1 commented 3 years ago

Indeed, changing the path to a newer version of OpenCV and setting CMAKE_CXX_STANDARD solved the problem. Thank you!