colmap / pycolmap

Python bindings for COLMAP
BSD 3-Clause "New" or "Revised" License
858 stars 125 forks source link

bug while install pycolmap #240

Closed fangli333 closed 5 months ago

fangli333 commented 5 months ago

Hi,

I use colmap version 3.9.1 and pycolmap version v0.5.0, I think the versions are right, but it still shows the following errors.

Processing /home/ubuntu/pycolmap Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: numpy in /home/ubuntu/.local/lib/python3.8/site-packages (from pycolmap==0.5.0) (1.21.6) Building wheels for collected packages: pycolmap Building wheel for pycolmap (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for pycolmap (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [104 lines of output] scikit-build-core 0.7.1 using CMake 3.16.3 (wheel) Configuring CMake... loading initial cache file /tmp/tmptqnzslea/build/CMakeInit.txt -- The C compiler identification is GNU 9.4.0 -- The CXX compiler identification is GNU 9.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found version "1.71.0") found components: filesystem graph program_options system -- Found Eigen3: /usr/include/eigen3 (Required is at least version "2.91.0") -- Found Eigen -- Includes : /usr/include/eigen3 -- Found FreeImage -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libfreeimage.so -- Found FLANN -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libflann.so -- Found LZ4 -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/liblz4.so -- Found Metis -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libmetis.so -- Found Glog -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libglog.so -- Found SQLite3 -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libsqlite3.so -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so -- Found Glew -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libGLEW.so -- Found Git: /usr/bin/git (found version "2.25.1") -- Found installed version of Eigen: /usr/lib/cmake/eigen3 -- Found required Ceres dependency: Eigen version 3.3.7 in /usr/include/eigen3 -- Found required Ceres dependency: glog -- Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags -- Detected gflags version: 2.2.2 -- Found required Ceres dependency: gflags -- Found Ceres version: 1.14.0 installed in: /usr with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, OpenMP, Multithreading] -- Enabling OpenMP support -- Using header-only CGAL -- Targetting Ninja -- Using /usr/bin/c++ compiler. -- Found GMP: /usr/lib/x86_64-linux-gnu/libgmp.so -- Found MPFR: /usr/lib/x86_64-linux-gnu/libmpfr.so -- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version "1.71.0", minimum required is "1.48") -- Boost include dirs: /usr/include -- Boost libraries: -- Using gcc version 4 or later. Adding -frounding-math -- Found CGAL -- Includes : /usr/include -- Libraries : CGAL -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Found CUDA version 11.8 installed in /usr via legacy CMake (<3.17) module. Using the legacy CMake module means that any installation of COLMAP will require that the CUDA libraries are available under LD_LIBRARY_PATH. -- Found CUDA -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libcudart_static.a;-lpthread;dl;/usr/lib/x86_64-linux-gnu/librt.so -- The CUDA compiler identification is NVIDIA 11.8.89 -- Check for working CUDA compiler: /usr/bin/nvcc -- Check for working CUDA compiler: /usr/bin/nvcc -- works -- Detecting CUDA compiler ABI info -- Detecting CUDA compiler ABI info - done -- Enabling CUDA support (version: 11.8, archs: native) -- Found Qt -- Module : /usr/lib/x86_64-linux-gnu/cmake/Qt5Core -- Module : /usr/lib/x86_64-linux-gnu/cmake/Qt5OpenGL -- Module : /usr/lib/x86_64-linux-gnu/cmake/Qt5Widgets -- Enabling GUI support -- Disabling OpenGL support -- Enabling GPU support CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find Python (missing: Interpreter Development.Module) (found version "3.8.18") Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.16/Modules/FindPython.cmake:347 (find_package_handle_standard_args) CMakeLists.txt:19 (find_package)

  -- Configuring incomplete, errors occurred!
  See also "/tmp/tmptqnzslea/build/CMakeFiles/CMakeOutput.log".
  See also "/tmp/tmptqnzslea/build/CMakeFiles/CMakeError.log".

  *** CMake configuration failed
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pycolmap Failed to build pycolmap ERROR: Could not build wheels for pycolmap, which is required to install pyproject.toml-based projects

can you help me on it?

sarlinpe commented 5 months ago

Could NOT find Python (missing: Interpreter Development.Module) (found version "3.8.18")

It seems that you're missing development headers, which can be installed on Ubuntu with apt-get install python3.8-dev.

fangli333 commented 5 months ago

i follow your words and it show success:

sudo apt-get install python3.8-dev Reading package lists... Done Building dependency tree
Reading state information... Done python3.8-dev is already the newest version (3.8.10-0ubuntu1~20.04.9). 0 upgraded, 0 newly installed, 0 to remove and 292 not upgraded.

but it still shows the bugs:

Processing /home/ubuntu/pycolmap Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: numpy in /home/ubuntu/anaconda3/lib/python3.11/site-packages (from pycolmap==0.5.0) (1.24.3) Building wheels for collected packages: pycolmap Building wheel for pycolmap (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for pycolmap (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [105 lines of output] scikit-build-core 0.7.1 using CMake 3.16.3 (wheel) Configuring CMake... 2024-01-20 06:56:14,941 - scikit_build_core - WARNING - libdir/ldlibrary: /home/ubuntu/anaconda3/lib/libpython3.11.a is not a real file! 2024-01-20 06:56:14,941 - scikit_build_core - WARNING - Can't find a Python library, got libdir=/home/ubuntu/anaconda3/lib, ldlibrary=libpython3.11.a, multiarch=x86_64-linux-gnu, masd=None loading initial cache file /tmp/tmp6_sqix1c/build/CMakeInit.txt -- The C compiler identification is GNU 9.4.0 -- The CXX compiler identification is GNU 9.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Boost: /home/ubuntu/anaconda3/lib/cmake/Boost-1.73.0/BoostConfig.cmake (found version "1.73.0") found components: filesystem graph program_options system -- Found Eigen3: /usr/include/eigen3 (Required is at least version "2.91.0") -- Found Eigen -- Includes : /usr/include/eigen3 -- Found FreeImage -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libfreeimage.so -- Found FLANN -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libflann.so -- Found LZ4 -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/liblz4.so -- Found Metis -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libmetis.so -- Found Glog -- Target : glog::glog -- Found SQLite3 -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libsqlite3.so -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so -- Found Glew -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libGLEW.so -- Found Git: /usr/bin/git (found version "2.25.1") -- Found installed version of Eigen: /usr/lib/cmake/eigen3 -- Found required Ceres dependency: Eigen version 3.3.7 in /usr/include/eigen3 -- Found required Ceres dependency: glog -- Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags -- Detected gflags version: 2.2.2 -- Found required Ceres dependency: gflags -- Found Ceres version: 1.14.0 installed in: /usr with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, OpenMP, Multithreading] -- Enabling OpenMP support -- Using header-only CGAL -- Targetting Ninja -- Using /usr/bin/c++ compiler. -- Found GMP: /usr/lib/x86_64-linux-gnu/libgmp.so -- Found MPFR: /usr/lib/x86_64-linux-gnu/libmpfr.so -- Found Boost: /home/ubuntu/anaconda3/lib/cmake/Boost-1.73.0/BoostConfig.cmake (found suitable version "1.73.0", minimum required is "1.48") -- Boost include dirs: /home/ubuntu/anaconda3/include -- Boost libraries: -- Using gcc version 4 or later. Adding -frounding-math -- Found CGAL -- Includes : /usr/include -- Libraries : CGAL -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Found CUDA version 11.8 installed in /usr via legacy CMake (<3.17) module. Using the legacy CMake module means that any installation of COLMAP will require that the CUDA libraries are available under LD_LIBRARY_PATH. -- Found CUDA -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libcudart_static.a;-lpthread;dl;/usr/lib/x86_64-linux-gnu/librt.so -- The CUDA compiler identification is NVIDIA 11.8.89 -- Check for working CUDA compiler: /usr/bin/nvcc -- Check for working CUDA compiler: /usr/bin/nvcc -- works -- Detecting CUDA compiler ABI info -- Detecting CUDA compiler ABI info - done -- Enabling CUDA support (version: 11.8, archs: native) -- Found Qt -- Module : /home/ubuntu/anaconda3/lib/cmake/Qt5Core -- Module : /home/ubuntu/anaconda3/lib/cmake/Qt5OpenGL -- Module : /home/ubuntu/anaconda3/lib/cmake/Qt5Widgets -- Enabling GUI support -- Disabling OpenGL support -- Enabling GPU support CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find Python (missing: Interpreter Development.Module) (found version "3.11.3") Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.16/Modules/FindPython.cmake:347 (find_package_handle_standard_args) CMakeLists.txt:19 (find_package)

  -- Configuring incomplete, errors occurred!
  See also "/tmp/tmp6_sqix1c/build/CMakeFiles/CMakeOutput.log".
  See also "/tmp/tmp6_sqix1c/build/CMakeFiles/CMakeError.log".

  *** CMake configuration failed
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pycolmap Failed to build pycolmap ERROR: Could not build wheels for pycolmap, which is required to install pyproject.toml-based projects

fangli333 commented 5 months ago

I follow your words and it shows like this:

sudo apt-get install python3.8-dev Reading package lists... Done Building dependency tree
Reading state information... Done python3.8-dev is already the newest version (3.8.10-0ubuntu1~20.04.9). 0 upgraded, 0 newly installed, 0 to remove and 292 not upgraded.

but it still show bugs:

Processing /home/ubuntu/pycolmap Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: numpy in /home/ubuntu/anaconda3/lib/python3.11/site-packages (from pycolmap==0.5.0) (1.24.3) Building wheels for collected packages: pycolmap Building wheel for pycolmap (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for pycolmap (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [105 lines of output] scikit-build-core 0.7.1 using CMake 3.16.3 (wheel) Configuring CMake... 2024-01-20 06:56:14,941 - scikit_build_core - WARNING - libdir/ldlibrary: /home/ubuntu/anaconda3/lib/libpython3.11.a is not a real file! 2024-01-20 06:56:14,941 - scikit_build_core - WARNING - Can't find a Python library, got libdir=/home/ubuntu/anaconda3/lib, ldlibrary=libpython3.11.a, multiarch=x86_64-linux-gnu, masd=None loading initial cache file /tmp/tmp6_sqix1c/build/CMakeInit.txt -- The C compiler identification is GNU 9.4.0 -- The CXX compiler identification is GNU 9.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Boost: /home/ubuntu/anaconda3/lib/cmake/Boost-1.73.0/BoostConfig.cmake (found version "1.73.0") found components: filesystem graph program_options system -- Found Eigen3: /usr/include/eigen3 (Required is at least version "2.91.0") -- Found Eigen -- Includes : /usr/include/eigen3 -- Found FreeImage -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libfreeimage.so -- Found FLANN -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libflann.so -- Found LZ4 -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/liblz4.so -- Found Metis -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libmetis.so -- Found Glog -- Target : glog::glog -- Found SQLite3 -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libsqlite3.so -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so -- Found Glew -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libGLEW.so -- Found Git: /usr/bin/git (found version "2.25.1") -- Found installed version of Eigen: /usr/lib/cmake/eigen3 -- Found required Ceres dependency: Eigen version 3.3.7 in /usr/include/eigen3 -- Found required Ceres dependency: glog -- Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags -- Detected gflags version: 2.2.2 -- Found required Ceres dependency: gflags -- Found Ceres version: 1.14.0 installed in: /usr with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, OpenMP, Multithreading] -- Enabling OpenMP support -- Using header-only CGAL -- Targetting Ninja -- Using /usr/bin/c++ compiler. -- Found GMP: /usr/lib/x86_64-linux-gnu/libgmp.so -- Found MPFR: /usr/lib/x86_64-linux-gnu/libmpfr.so -- Found Boost: /home/ubuntu/anaconda3/lib/cmake/Boost-1.73.0/BoostConfig.cmake (found suitable version "1.73.0", minimum required is "1.48") -- Boost include dirs: /home/ubuntu/anaconda3/include -- Boost libraries: -- Using gcc version 4 or later. Adding -frounding-math -- Found CGAL -- Includes : /usr/include -- Libraries : CGAL -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Found CUDA version 11.8 installed in /usr via legacy CMake (<3.17) module. Using the legacy CMake module means that any installation of COLMAP will require that the CUDA libraries are available under LD_LIBRARY_PATH. -- Found CUDA -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libcudart_static.a;-lpthread;dl;/usr/lib/x86_64-linux-gnu/librt.so -- The CUDA compiler identification is NVIDIA 11.8.89 -- Check for working CUDA compiler: /usr/bin/nvcc -- Check for working CUDA compiler: /usr/bin/nvcc -- works -- Detecting CUDA compiler ABI info -- Detecting CUDA compiler ABI info - done -- Enabling CUDA support (version: 11.8, archs: native) -- Found Qt -- Module : /home/ubuntu/anaconda3/lib/cmake/Qt5Core -- Module : /home/ubuntu/anaconda3/lib/cmake/Qt5OpenGL -- Module : /home/ubuntu/anaconda3/lib/cmake/Qt5Widgets -- Enabling GUI support -- Disabling OpenGL support -- Enabling GPU support CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find Python (missing: Interpreter Development.Module) (found version "3.11.3") Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.16/Modules/FindPython.cmake:347 (find_package_handle_standard_args) CMakeLists.txt:19 (find_package)

  -- Configuring incomplete, errors occurred!
  See also "/tmp/tmp6_sqix1c/build/CMakeFiles/CMakeOutput.log".
  See also "/tmp/tmp6_sqix1c/build/CMakeFiles/CMakeError.log".

  *** CMake configuration failed
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pycolmap Failed to build pycolmap ERROR: Could not build wheels for pycolmap, which is required to install pyproject.toml-based projects

fangli333 commented 5 months ago

i also tried to use pip install, and it show the following bugs: image

jytime commented 5 months ago

I am not a developer of pycolmap while it looks the cmake file found the wrong version of python dev files, and 3.11 is not supported by pycolmap now.

Could NOT find Python (missing: Interpreter Development.Module) (found
version "3.11.3")

Regarding using pip, pip install pycolmap seems works quite well for me. I would suggest to create a new conda env and ensure not previous cache exists. Then installing pycolmap by pip should work there.

And I personally think it may be easier to start from hloc instead of pycolmap.

sarlinpe commented 5 months ago

@fangli333

Anyway this seems to be an issue with your system, not with pycolmap.