1
$\begingroup$

I'm trying to install ROS 2 Iron into a new conda environment on my Mac (ARM architecture). I was following the instructions in this documentation but when I run colcon build --symlink-install --packages-skip-by-dep python_qt_binding I get the following error:

Traceback (most recent call last):
  File "/Users/jkelle/ros2_iron/src/ament/ament_cmake/ament_cmake_core/cmake/core/package_xml_2_cmake.py", line 22, in <module>
    from catkin_pkg.package import parse_package_string
ModuleNotFoundError: No module named 'catkin_pkg'

...

ERROR:colcon.colcon_notification.desktop_notification.terminal_notifier:Could not find the colcon-terminal-notifier.app in the install prefix '/Users/jkelle/miniconda3/envs/spl_ros'

I can see that catkin_pkg is installed an importable in my conda environment:

>> conda list | grep catkin_pkg
catkin_pkg                1.0.0              pyhd8ed1ab_0    conda-forge
>> python -c "from catkin_pkg.package import parse_package_string; print('success')"
success

I didn't disable SIP because I found this discussion suggesting it might not be necessary, and I really don't want to disable it if I don't need to.

My questions now are:

  1. Is there a working conda installation option?
  2. Do I really need to disable SIP?
  3. How should I proceed?
$\endgroup$
2
  • $\begingroup$ I have same issue on fresh installation of macOS Sonoma 14.2.1 on M1 core and SIP disabled. $\endgroup$
    – karelok
    Commented Jan 7 at 16:44
  • $\begingroup$ I try to build colcon from source, but no success. I am still getting error "Could not find the colcon-terminal-notifier.app." However I have checked the content of folder colcon-from-source/install/colcon-notification/ and the colcon-terminal-notifier.app is present in subfolder share/colcon-notification/. $\endgroup$
    – karelok
    Commented Jan 7 at 17:39

2 Answers 2

0
$\begingroup$

After some examination on macOS Sonoma I have managed to run colcon build --symlink-install --packages-skip-by-dep python_qt_binding. I am not completely done with build, but I made good progress. Below I summarize "hot fixes" I did. It is not clean approach, but it will enable to move on.

Prerequisities:

  • you work in python virtual environment (venv)
  • all ven prerequisites from Humble build tutorial are in place

Resolution of issue:

  1. build colcon from source as described on colcon install page

  2. Check how is EXACT name of colcon terminal notifier filename in: /YOUR_PATH/colcon-from-source/install/colcon-notification/share/colcon_notification

  3. Look for file: 'YOUR_PATH/colcon-from-source/install/colcon-notification/lib/python3.11/site-packages/colcon_notification/desktop_notification/terminal_notifier.py'

  4. Fix file name in function def _get_app_path(prefix_path):. In my case the name was: colcon-terminal-notifier instead of colcon_terminal_notifier

  5. Additional issue occurs with python interpreter reference. I was unable to manipulate python target via colcon switch and environment settings. I just updated the makefiles directly, i.e.:

    ament_package_xml.cmake:
    ...
    set(_cmd
        #"${_python_interpreter}"
        "/YOUR_PATH/colcon-venv/bin/python"
        "${ament_cmake_core_DIR}/core/package_xml_2_cmake.py"
        "${PACKAGE_XML_DIRECTORY}/package.xml"
        "${dest_dir}/package.cmake"
    )
    
$\endgroup$
0
$\begingroup$

In my case installing catkin_pkg in conda's base environment solved the issue.

pip install catkin_pkg

For more detailed answer, please refer 1st (numan) answer in this link

https://stackoverflow.com/questions/77351644/ros2-catkin-pkg-not-found-is-installed-and-using-version-3-8

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.