ethz-asl / kalibr

The Kalibr visual-inertial calibration toolbox
Other
4.28k stars 1.39k forks source link

Building error related with "numpy_eigen" package: invalid command 'numpy_eigen' #562

Closed lenardxu closed 2 years ago

lenardxu commented 2 years ago

Greetings! Here is a building problem when I refer to the installation procedure (https://github.com/ethz-asl/kalibr/wiki/installation) and proceed to the building step using yours catkin build -DCMAKE_BUILD_TYPE=Release -j4:

--------------------------------------------------------------------------------------
Profile:                     default
Extending:        [explicit] /opt/ros/noetic
Workspace:                   /home/rukangxu/MA_IAS/camera_imu/kalibr_workspace
--------------------------------------------------------------------------------------
Build Space:        [exists] /home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/build
Devel Space:        [exists] /home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/devel
Install Space:      [unused] /home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/install
Log Space:         [missing] /home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/logs
Source Space:       [exists] /home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/src
DESTDIR:            [unused] None
--------------------------------------------------------------------------------------
Devel Space Layout:          merged
Install Space Layout:        None
--------------------------------------------------------------------------------------
Additional CMake Args:       -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_TYPE=Release
Additional Make Args:        -j2
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
--------------------------------------------------------------------------------------
Buildlisted Packages:        None
Skiplisted Packages:         None
--------------------------------------------------------------------------------------
Workspace configuration appears valid.

NOTE: Forcing CMake to run for each package.
--------------------------------------------------------------------------------------
[build] Found 36 packages in 0.0 seconds.                                                                                                                                                                         
[build] Updating package table.                                                                                                                                                                                   
Starting  >>> aslam_time                                                                                                                                                                                          
Starting  >>> catkin_simple                                                                                                                                                                                       
Finished  <<< catkin_simple                                 [ 2.1 seconds ]                                                                                                                                       
Starting  >>> ethz_apriltag2                                                                                                                                                                                      
__________________________________________________________________________________________________________________________________________________________________________________________________________________
Warnings   << aslam_time:make /home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/logs/aslam_time/build.make.000.log                                                                                                
/home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/src/kalibr/aslam_cv/aslam_time/src/time.cpp:84:25: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
   84 |                         throw (NoHighPerformanceTimersException)
      |                         ^~~~~
cd /home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/build/aslam_time; catkin build --get-env aslam_time | catkin env -si  /usr/bin/make --jobserver-auth=3,4; cd -

..................................................................................................................................................................................................................
Finished  <<< aslam_time                                    [ 5.4 seconds ]                                                                                                                                       
Starting  >>> opencv2_catkin                                                                                                                                                                                      
Finished  <<< opencv2_catkin                                [ 1.9 seconds ]                                                                                                                                       
Starting  >>> python_module                                                                                                                                                                                       
Finished  <<< python_module                                 [ 1.9 seconds ]                                                                                                                                       
Starting  >>> numpy_eigen                                                                                                                                                                                         
Finished  <<< ethz_apriltag2                                [ 15.6 seconds ]                                                                                                                                      
Starting  >>> sm_common                                                                                                                                                                                           
__________________________________________________________________________________________________________________________________________________________________________________________________________________
Errors     << numpy_eigen:cmake /home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/logs/numpy_eigen/build.cmake.000.log                                                                                            
/opt/ros/noetic/lib/python3/dist-packages/_distutils_hack/__init__.py:18: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
  warnings.warn(
/opt/ros/noetic/lib/python3/dist-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

ERROR: invalid command 'numpy_eigen'
CMake Error at /opt/ros/noetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):

  execute_process(/home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/build/numpy_eigen/catkin_generated/env_cached.sh
  "/usr/bin/python3"
  "/opt/ros/noetic/share/catkin/cmake/interrogate_setup_dot_py.py"
  "numpy_eigen"
  "/home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/src/kalibr/Schweizer-Messer/numpy_eigen/setup.py"
  "/home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/build/numpy_eigen/catkin_generated/setup_py_interrogation.cmake")
  returned error code 1
Call Stack (most recent call first):
  /opt/ros/noetic/share/catkin/cmake/catkin_python_setup.cmake:46 (safe_execute_process)
  CMakeLists.txt:10 (catkin_python_setup)

cd /home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/build/numpy_eigen; catkin build --get-env numpy_eigen | catkin env -si  /usr/bin/cmake /home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/src/kalibr/Schweizer-Messer/numpy_eigen --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/devel -DCMAKE_INSTALL_PREFIX=/home/rukangxu/MA_IAS/camera_imu/kalibr_workspace/install -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_TYPE=Release; cd -

..................................................................................................................................................................................................................
Failed     << numpy_eigen:cmake                             [ Exited with code 1 ]                                                                                                                                
Failed    <<< numpy_eigen                                   [ 2.1 seconds ]                                                                                                                                       
Abandoned <<< sm_logging                                    [ Unrelated job failed ]                                                                                                                              
Abandoned <<< sm_random                                     [ Unrelated job failed ]                                                                                                                              
Abandoned <<< sm_boost                                      [ Unrelated job failed ]                                                                                                                              
Abandoned <<< sm_matrix_archive                             [ Unrelated job failed ]                                                                                                                              
Abandoned <<< sm_opencv                                     [ Unrelated job failed ]                                                                                                                              
Abandoned <<< sm_property_tree                              [ Unrelated job failed ]                                                                                                                              
Abandoned <<< sm_eigen                                      [ Unrelated job failed ]                                                                                                                              
Abandoned <<< sm_kinematics                                 [ Unrelated job failed ]                                                                                                                              
Abandoned <<< aslam_cameras                                 [ Unrelated job failed ]                                                                                                                              
Abandoned <<< aslam_cv_serialization                        [ Unrelated job failed ]                                                                                                                              
Abandoned <<< aslam_imgproc                                 [ Unrelated job failed ]                                                                                                                              
Abandoned <<< sm_timing                                     [ Unrelated job failed ]                                                                                                                              
Abandoned <<< sm_python                                     [ Unrelated job failed ]                                                                                                                              
Abandoned <<< aslam_cameras_april                           [ Unrelated job failed ]                                                                                                                              
Abandoned <<< aslam_cv_python                               [ Unrelated job failed ]                                                                                                                              
Abandoned <<< sparse_block_matrix                           [ Unrelated job failed ]                                                                                                                              
Abandoned <<< aslam_backend                                 [ Unrelated job failed ]                                                                                                                              
Abandoned <<< aslam_backend_expressions                     [ Unrelated job failed ]                                                                                                                              
Abandoned <<< aslam_backend_python                          [ Unrelated job failed ]                                                                                                                              
Abandoned <<< aslam_cv_backend                              [ Unrelated job failed ]                                                                                                                              
Abandoned <<< bsplines                                      [ Unrelated job failed ]                                                                                                                              
Abandoned <<< aslam_splines                                 [ Unrelated job failed ]                                                                                                                              
Abandoned <<< aslam_cv_error_terms                          [ Unrelated job failed ]                                                                                                                              
Abandoned <<< aslam_cv_backend_python                       [ Unrelated job failed ]                                                                                                                              
Abandoned <<< bsplines_python                               [ Unrelated job failed ]                                                                                                                              
Abandoned <<< aslam_splines_python                          [ Unrelated job failed ]                                                                                                                              
Abandoned <<< incremental_calibration                       [ Unrelated job failed ]                                                                                                                              
Abandoned <<< incremental_calibration_python                [ Unrelated job failed ]                                                                                                                              
Abandoned <<< kalibr                                        [ Unrelated job failed ]                                                                                                                              
Finished  <<< sm_common                                     [ 2.4 seconds ]                                                                                                                                       
[build] Summary: 6 of 36 packages succeeded.                                                                                                                                                                      
[build]   Ignored:   None.                                                                                                                                                                                        
[build]   Warnings:  1 packages succeeded with warnings.                                                                                                                                                          
[build]   Abandoned: 29 packages were abandoned.                                                                                                                                                                  
[build]   Failed:    1 packages failed.                                                                                                                                                                           
[build] Runtime: 21.0 seconds total.                                                                                                                                                                              
[build] Note: Workspace packages have changed, please re-source setup files to use them.

I then found the post having the same issue as mine, shown here: #550 . However, there is still no effective solution, since I tried the solution shared by that author, by reinstalling ROS, which turned out to be ineffective.

Could anyone help me out of this situation? Many many thanks in advance.

lenardxu commented 2 years ago

I've solved that problem by myself. The cause is that Disutils was imported before Setuptools for installation of modules/scripts of numpy_eigen package. To solve this, you can update Setuptools to the latest version by using

pip3 install --user --upgrade pip setuptools

if you're using python3 in Linux-OS (for eg, ubuntu, debian) and have pip3 installed.