No rule to make target python3.9a when running ros2genmsg
Ältere Kommentare anzeigen
Hi,
I am trying to read a ros2 bag file into Matlab. Since this bag file contains custom msgs, I understand that I need to run ros2genmsg on the directories containing the packages with the definitions of theses msgs.
- Freshly installed Ubuntu 20.04
- Installed python3.9, python3.9-dev
- set pyenv to the python3.9 path
- run ros2genmsg on directory
- Matlab starts building the msg interfaces
- Make fails with make[2]: *** No rule to make target '/home/user/.matlab/R2022a/ros2/glnxa64/venv/lib/libpython3.9.a', needed by 'rosidl_generator_py/XXXXXXXXmsgs/libXXXXXXXXmsgs__python.so'. Stop.
What am I doing wrong?
Identifying message files in folder '/home/user/packages/my_msg'..Done.
Validating message files in folder '/home/user/packages/my_msg'..Done.
[2/2] Generating MATLAB interfaces for custom message packages... Done.
Running colcon build in folder '/home/user/packages/my_msg/matlab_msg_gen/glnxa64'.
Build in progress. This may take several minutes...Error using ros.internal.ROSProjectBuilder/buildPackage
Error building package: build log.
Error in ros2genmsg (line 279)
buildPackage(builder, [], ' --merge-install', colconMakeArgs); %other messages might need to be present in the same directory
Error in ground_non_ground (line 2)
ros2genmsg("/home/user/packages/my_msg")
1 Kommentar
Max Hochlenert
am 12 Sep. 2022
Bearbeitet: Max Hochlenert
am 12 Sep. 2022
Antworten (1)
Hari Krishna Kakarla
am 12 Sep. 2022
Verschoben: Remo Pillat
am 10 Nov. 2023
0 Stimmen
Hi Max,
It looks like, this is an issue with MATLAB Installation. I see that you have installed python3.9-dev. Please install python3.9-venv as well and re-create the python virtual environment.
- Install python 3.9-venv
- Point pyenv to installed python in MATLAB.
- ros.ros2.internal.createOrGetLocalPython(true)
Now ros2genmsg should work. If you are encountering the same error again, then you might need to re-install your python by setting "--enable-shared" flag:
- PYTHON_CONFIGURE_OPTS="--enable-shared"
- Now, re-install the required python.
- ros.ros2.internal.createOrGetLocalPython(true)
After doing above steps, ros2genmsg should work. I hope this solves the problem. Please let me know if you are still encountering the errors.
Thanks
Hari
Kategorien
Mehr zu Call Python from MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!