Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) #7

Open
tomkimsour opened this issue Jun 1, 2022 · 2 comments
Labels

Comments

@tomkimsour
Copy link

Hey, I'm trying to compile the new version of ros2 on mac m1 but I am having a CMake error.

Starting >>> class_loader
--- stderr: python_orocos_kdl_vendor
CMake Error at /opt/homebrew/Cellar/cmake/3.23.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
  (Required is at least version "3.8")
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.23.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /opt/homebrew/Cellar/cmake/3.23.2/share/cmake/Modules/FindPythonLibs.cmake:310 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  /Users/tomkimsour/ros2_humble/build/python_orocos_kdl_vendor/_deps/python_orocos_kdl-src/python_orocos_kdl/CMakeLists.txt:29 (find_package)


---
Failed   <<< python_orocos_kdl_vendor [4.54s, exited with code 1]
Aborted  <<< libyaml_vendor [2.69s]
Aborted  <<< class_loader [2.93s]
Aborted  <<< rcl_logging_interface [5.59s]
Aborted  <<< rosidl_generator_cpp [14.8s]
Aborted  <<< rmw [27.4s]
Aborted  <<< fastrtps [4min 35s]
Aborted  <<< rviz_ogre_vendor [6min 35s]

my python version is : Python 3.8.13
and all the installation steps went without any error.

@clalancette
Copy link
Contributor

Likely you need to install the Python development libraries somehow.

That said, macOS is a community supported platform, so there is no official support for it. If you do figure out how to make it work, please feel free to submit a PR to this repository or to https://github.com/ros2/ros2_documentation on what you needed to get it going. We'll be happy to review it.

@coalman321
Copy link

coalman321 commented Aug 7, 2022

This may help as well, but it might be an issue with the way FindPython3 works in CMake 3.22 vs older versions (3.16 tested). Attempting a source build of humble against Ubuntu 20.04 produces a similar result. The find call somehow manages to find python 3.9 on the system but not the default 3.8 interpreter even though python3 is set to the 3.8 interpreter. It will then fail the build at this stage.

If you feed colcon the following CMake arg, it should resolve the issue.
-DPython3_EXECUTABLE=/usr/bin/python3
NOTE: this arg is specifically for Ubuntu 20.04, change the path to be correct for your interpreter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants