ubuntu CMake找不到Python开发目录

6l7fqoea  于 2023-04-05  发布在  Python
关注(0)|答案(1)|浏览(144)

我想用ubuntu 20.04和python绑定在Jetson Xavier nx dev-kit上安装librealsense v2.50,如下所示:

~/Downloads/librealsense-2.50.0/build$ cmake ../ -DFORCE_LIBUVC=true\
-DCMAKE_BUILD_TYPE=release \
-DBUILD_WITH_CUDA=true -DBUILD_PYTHON_BINDINGS=true\
-DBUILD_NODEJS_BINDINGS=true -DPYTHON_EXECUTABLE=/usr/bin/python3\
-DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true\
-DPYTHON_INCLUDE_DIR=/usr/include/python3.8 \
-DPYTHON_LIBRARY=/usr/lib/libpython3.8.so

我得到了以下输出:

CMake Warning:
-- Checking internet connection...
-- Internet connection identified
CMake Deprecation Warning at CMakeLists.txt:9 (MESSAGE):
  FORCE_LIBUVC, FORCE_WINUSB_UVC and ANDROID_USB_HOST_UVC are deprecated, use
  FORCE_RSUSB_BACKEND instead

-- Info: REALSENSE_VERSION_STRING=2.50.0
-- Setting Unix configurations
-- Info: Building with CUDA requires CMake v3.8+
-- CUDA_LIBRARIES: /usr/local/cuda-11.4/include /usr/local/cuda-11.4/lib64/libcudart_static.a;Threads::Threads;dl;/usr/lib/aarch64-linux-gnu/librt.so;/usr/local/cuda-11.4/lib64/libcusparse.so;/usr/local/cuda-11.4/lib64/libcublas.so
-- Building libcurl enabled
-- using RS2_USE_LIBUVC_BACKEND
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/marvin/Downloads/librealsense-2.50.0/build/external-projects/pybind11
[ 12%] Performing update step for 'pybind11'
[ 25%] No patch step for 'pybind11'
[ 37%] No configure step for 'pybind11'
[ 50%] No build step for 'pybind11'
[ 62%] No install step for 'pybind11'
[ 75%] Completed 'pybind11'
[100%] Built target pybind11
-- pybind11 v2.6.2

然后我得到一个错误:

CMake Error at /usr/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Python (missing: Python_INCLUDE_DIRS Development
  Development.Module Development.Embed) (found version "2.7.18")
Call Stack (most recent call first):
  /usr/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:600 
(_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.26/Modules/FindPython.cmake:622 
(find_package_handle_standard_args)
  wrappers/python/CMakeLists.txt:63 (find_package)

我已经解决了这个错误之前从cmake find python中删除Development目录,但我现在找不到它,你能告诉我如何解决这个问题吗?

hfyxw5xn

hfyxw5xn1#

作为一种变通方法,我从python Package 器cmake文件中删除了Development目录,它对我很有效。

相关问题