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

colcon build keeps erroring #450

Open
FL3UR-TOUW opened this issue Feb 19, 2025 · 6 comments
Open

colcon build keeps erroring #450

FL3UR-TOUW opened this issue Feb 19, 2025 · 6 comments

Comments

@FL3UR-TOUW
Copy link

Hello Guys,

i am trying to get the sick_scan_xp on my computer to work with my picoscan.
i already setup ros2 humble and that works fine, and run python 3.10.0 with the python_d.exe version (the debug version installed).
now i have ran this:
cd C:
mkdir sick_scan_ws
cd sick_scan_ws
mkdir .\src
pushd .\src
git clone -b master https://github.com/SICKAG/sick_scan_xd.git
popd
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64
call C:\dev\ros2_humble\ros2-windows\setup.bat

when i tried to build with colcon it gave multiple problems, i tried to resolve them using this:

python -m pip install --upgrade pip
pip install -U colcon-common-extensions
python -m pip install rosdep
pip install empy==3.3.4
python -m pip install numpy

now i try to run the:
colcon build --packages-select sick_scan_xd --cmake-args " -DROS_VERSION=2" --event-handlers console_direct+

but it says that i have some issues with my numpy regarding a certain file, but this file exists! the colcon build always uses the python_d.exe and not my python.exe and if i try to delete the python_d.exe it says that it can't find this file and won't work either. can someone please help me?

@weinmalSICKAG
Copy link
Collaborator

Hello,
the installation instructions for Ros Humble require you to install Python 3.8. Make sure that is not the issue. If you have multiple Python versions installed on your system make sure that you install packages in the Python version that is used by Ros.
Let me know if the issue persists.

@FL3UR-TOUW
Copy link
Author

Hello, the installation instructions for Ros Humble require you to install Python 3.8. Make sure that is not the issue. If you have multiple Python versions installed on your system make sure that you install packages in the Python version that is used by Ros. Let me know if the issue persists.

I've tried both, python3.10.0 and python3.8.3.
ros2 humble works with both! but the numpy packages are not complete if i use python 3.8.3 to download them. I think the problem is with the CMake files who always use the python_d.exe but i don't know for sure.
Thank you in advance!

@weinmalSICKAG
Copy link
Collaborator

Please post the output of the colcon command. Thank you.

@FL3UR-TOUW
Copy link
Author

Please post the output of the colcon command. Thank you.

this is the ouput:

c:\sick_scan_ws>colcon build --packages-select sick_scan_xd --cmake-args " -DROS_VERSION=2" --event-handlers console_direct+

Starting >>> sick_scan_xd
CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
Compatibility with CMake < 3.10 will be removed from a future version of
CMake.

Update the VERSION argument value. Or, use the ... syntax
to tell CMake that the project requires at least but has been updated
to work with policies introduced by or earlier.

-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.26100.
-- The C compiler identification is MSVC 19.29.30158.0
-- The CXX compiler identification is MSVC 19.29.30158.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - 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: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Option CMAKE_ENABLE_EMULATOR = , building sick_scan_xd without emulator support, ENABLE_EMULATOR=OFF
-- ROS_VERSION precheck: ENV{ROS_VERSION}=2 ENV{ROS_DISTRO}=humble ROS_VERSION=2 CMAKE_PREFIX_PATH=
-- ROS_VERSION=2
-- GITHASH: 7cab14f
-- GITINFO:
Found version "3.6.0" in file "package.xml" and version "3.6.0" in file "include/sick_scan/sick_scan_xd_version.h"
Found identical versions, leaving file "include/sick_scan/sick_scan_xd_version.h" unmodified
-- Found ament_cmake: 1.3.11 (C:/dev/ros2_humble/ros2-windows/share/ament_cmake/cmake)
-- Found Python3: C:/Python38/python.exe (found version "3.8.3") found components: Interpreter
-- Found diagnostic_msgs: 4.2.4 (C:/dev/ros2_humble/ros2-windows/share/diagnostic_msgs/cmake)
-- Found rosidl_generator_c: 3.1.6 (C:/dev/ros2_humble/ros2-windows/share/rosidl_generator_c/cmake)
-- Found rosidl_adapter: 3.1.6 (C:/dev/ros2_humble/ros2-windows/share/rosidl_adapter/cmake)
-- Found rosidl_generator_cpp: 3.1.6 (C:/dev/ros2_humble/ros2-windows/share/rosidl_generator_cpp/cmake)
-- Using all available rosidl_typesupport_c: rosidl_typesupport_fastrtps_c;rosidl_typesupport_introspection_c
-- Using all available rosidl_typesupport_cpp: rosidl_typesupport_fastrtps_cpp;rosidl_typesupport_introspection_cpp
-- Found geometry_msgs: 4.2.4 (C:/dev/ros2_humble/ros2-windows/share/geometry_msgs/cmake)
-- Found nav_msgs: 4.2.4 (C:/dev/ros2_humble/ros2-windows/share/nav_msgs/cmake)
-- Found rclcpp: 16.0.11 (C:/dev/ros2_humble/ros2-windows/share/rclcpp/cmake)
-- Found rmw_implementation_cmake: 6.1.2 (C:/dev/ros2_humble/ros2-windows/share/rmw_implementation_cmake/cmake)
-- Found rmw_fastrtps_cpp: 6.2.7 (C:/dev/ros2_humble/ros2-windows/share/rmw_fastrtps_cpp/cmake)
-- Found FastRTPS: /opt/ros/humble/include
-- Using RMW implementation 'rmw_fastrtps_cpp' as default
-- 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 - not found
-- Found Threads: TRUE
-- Found rosidl_default_generators: 1.2.0 (C:/dev/ros2_humble/ros2-windows/share/rosidl_default_generators/cmake)
-- Found sensor_msgs: 4.2.4 (C:/dev/ros2_humble/ros2-windows/share/sensor_msgs/cmake)
-- Found tf2: 0.25.9 (C:/dev/ros2_humble/ros2-windows/share/tf2/cmake)
-- Found tf2_ros: 0.25.9 (C:/dev/ros2_humble/ros2-windows/share/tf2_ros/cmake)
-- Found visualization_msgs: 4.2.4 (C:/dev/ros2_humble/ros2-windows/share/visualization_msgs/cmake)
-- Found ament_cmake_ros: 0.10.0 (C:/dev/ros2_humble/ros2-windows/share/ament_cmake_ros/cmake)
-- Using all available rosidl_typesupport_c: rosidl_typesupport_fastrtps_c;rosidl_typesupport_introspection_c
-- Using all available rosidl_typesupport_cpp: rosidl_typesupport_fastrtps_cpp;rosidl_typesupport_introspection_cpp
CMake Warning (dev) at C:/dev/ros2_humble/ros2-windows/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:20 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
C:/dev/ros2_humble/ros2-windows/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
C:/dev/ros2_humble/ros2-windows/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
CMakeLists.txt:382 (rosidl_generate_interfaces)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Found PythonInterp: C:/Python38/python.exe (found suitable version "3.8.3", minimum required is "3.6")
-- Found python_cmake_module: 0.10.0 (C:/dev/ros2_humble/ros2-windows/share/python_cmake_module/cmake)
CMake Warning (dev) at C:/dev/ros2_humble/ros2-windows/share/python_cmake_module/cmake/Modules/FindPythonExtra.cmake:52 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
C:/dev/ros2_humble/ros2-windows/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:23 (find_package)
C:/dev/ros2_humble/ros2-windows/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
C:/dev/ros2_humble/ros2-windows/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
CMakeLists.txt:382 (rosidl_generate_interfaces)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at C:/dev/ros2_humble/ros2-windows/share/python_cmake_module/cmake/Modules/FindPythonExtra.cmake:140 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
C:/dev/ros2_humble/ros2-windows/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:23 (find_package)
C:/dev/ros2_humble/ros2-windows/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
C:/dev/ros2_humble/ros2-windows/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
CMakeLists.txt:382 (rosidl_generate_interfaces)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Found PythonLibs: optimized;C:/Python38/libs/python38.lib;debug;C:/Python38/libs/python38_d.lib (found suitable version "3.8.3", minimum required is "3.5")
-- Using PYTHON_EXECUTABLE: C:/Python38/python.exe
-- Using PYTHON_INCLUDE_DIRS: C:/Python38/include
-- Using PYTHON_LIBRARIES: optimized;C:/Python38/libs/python38.lib;debug;C:/Python38/libs/python38_d.lib
-- Found PythonExtra: d.pyd
Traceback (most recent call last):
File "C:\Python38\lib\site-packages\numpy\core_init
.py", line 23, in
from . import multiarray
File "C:\Python38\lib\site-packages\numpy\core\multiarray.py", line 10, in
from . import overrides
File "C:\Python38\lib\site-packages\numpy\core\overrides.py", line 6, in
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "C:\Python38\lib\site-packages\numpy_init_.py", line 141, in
from . import core
File "C:\Python38\lib\site-packages\numpy\core_init_.py", line 49, in
raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.8 from "C:\Python38\python_d.exe"
  • The NumPy version is: "1.24.4"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

CMake Error at C:/dev/ros2_humble/ros2-windows/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:204 (message):
execute_process(C:/Python38/python_d.exe -c 'import
numpy;print(numpy.get_include())') returned error code 1
Call Stack (most recent call first):
C:/dev/ros2_humble/ros2-windows/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
C:/dev/ros2_humble/ros2-windows/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
CMakeLists.txt:382 (rosidl_generate_interfaces)

-- Configuring incomplete, errors occurred!
--- stderr: sick_scan_xd
CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
Compatibility with CMake < 3.10 will be removed from a future version of
CMake.

Update the VERSION argument value. Or, use the ... syntax
to tell CMake that the project requires at least but has been updated
to work with policies introduced by or earlier.

CMake Warning (dev) at C:/dev/ros2_humble/ros2-windows/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:20 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
C:/dev/ros2_humble/ros2-windows/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
C:/dev/ros2_humble/ros2-windows/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
CMakeLists.txt:382 (rosidl_generate_interfaces)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at C:/dev/ros2_humble/ros2-windows/share/python_cmake_module/cmake/Modules/FindPythonExtra.cmake:52 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
C:/dev/ros2_humble/ros2-windows/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:23 (find_package)
C:/dev/ros2_humble/ros2-windows/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
C:/dev/ros2_humble/ros2-windows/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
CMakeLists.txt:382 (rosidl_generate_interfaces)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at C:/dev/ros2_humble/ros2-windows/share/python_cmake_module/cmake/Modules/FindPythonExtra.cmake:140 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
C:/dev/ros2_humble/ros2-windows/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:23 (find_package)
C:/dev/ros2_humble/ros2-windows/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
C:/dev/ros2_humble/ros2-windows/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
CMakeLists.txt:382 (rosidl_generate_interfaces)
This warning is for project developers. Use -Wno-dev to suppress it.

Traceback (most recent call last):
File "C:\Python38\lib\site-packages\numpy\core_init_.py", line 23, in
from . import multiarray
File "C:\Python38\lib\site-packages\numpy\core\multiarray.py", line 10, in
from . import overrides
File "C:\Python38\lib\site-packages\numpy\core\overrides.py", line 6, in
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "C:\Python38\lib\site-packages\numpy_init_.py", line 141, in
from . import core
File "C:\Python38\lib\site-packages\numpy\core_init_.py", line 49, in
raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.8 from "C:\Python38\python_d.exe"
  • The NumPy version is: "1.24.4"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

CMake Error at C:/dev/ros2_humble/ros2-windows/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:204 (message):
execute_process(C:/Python38/python_d.exe -c 'import
numpy;print(numpy.get_include())') returned error code 1
Call Stack (most recent call first):
C:/dev/ros2_humble/ros2-windows/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
C:/dev/ros2_humble/ros2-windows/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
CMakeLists.txt:382 (rosidl_generate_interfaces)


Failed <<< sick_scan_xd [19.5s, exited with code 1]

Summary: 0 packages finished [19.9s]
1 package failed: sick_scan_xd
1 package had stderr output: sick_scan_xd

i realy don't know what i can change or do to resolve this problem!

@weinmalSICKAG
Copy link
Collaborator

To me this looks like numpy is not properly installed in your Python 3.8 installation. To check this, you can start Python located at C:\Python38\python_d.exe and run the following command import numpy.core._multiarray_umath. If this fails, you should install the Python packages given in the documentation: https://docs.ros.org/en/humble/Installation/Alternatives/Windows-Development-Setup.html#install-dependencies
For this you need to ensure that pip installs the packages in the correct Python version. Install the packages by explicitly calling pip of Python 3.8:

C:\Python38\python.exe -m pip install -U pip setuptools==59.6.0
C:\Python38\python.exe -m pip install -U catkin_pkg cryptography empy importlib-metadata lark==1.1.1 lxml matplotlib netifaces numpy opencv-python PyQt5 pillow psutil pycairo pydot pyparsing==2.4.7 pyyaml rosdistro

@FL3UR-TOUW
Copy link
Author

i think i found a solution for the colcon-build error!
i wanted to make sure that when building the space python.exe was used and not python_d.exe so i looked for a file where the python version was selected.
in this path (in my case) : C:\dev\ros2_humble\ros2-windows\share\rosidl_generator_py\cmake\rosidl_generator_py_generate_interfaces.cmake
on line 131 i changed set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}) #PYTHON_EXECUTABLE_DEBUG changed into PYTHON_EXECUTABLE
so now when building it uses my PYTHON_EXECUTABLE instead of PYTHON_EXECUTABLE_DEBUG
Now i builds just fine!

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

No branches or pull requests

2 participants