<class 'ModuleNotFoundError'>: No module named 'genmsg'
Dear community
I am trying to build ROS noetic from source on a raspberry pi with the most recent OctoPi image. I concluded that I had to do an installation from source (please correct me if that assumption is wrong) and now I am stuck while building the workspace with catkin build
. The relevant part:
pi@octopi:~/catkin_ws/src/std_msgs $ catkin build --this
-------------------------------------------------------
Profile: default
Extending: None
Workspace: /home/pi/catkin_ws
-------------------------------------------------------
Build Space: [exists] /home/pi/catkin_ws/build
Devel Space: [exists] /home/pi/catkin_ws/devel
Install Space: [exists] /home/pi/catkin_ws/install
Log Space: [exists] /home/pi/catkin_ws/logs
Source Space: [exists] /home/pi/catkin_ws/src
DESTDIR: [unused] None
-------------------------------------------------------
Devel Space Layout: linked
Install Space Layout: merged
-------------------------------------------------------
Additional CMake Args: -DCMAKE_BUILD_TYPE=Release
Additional Make Args: None
Additional catkin Make Args: None
Internal Make Job Server: True
Cache Job Environments: False
-------------------------------------------------------
Whitelisted Packages: None
Blacklisted Packages: None
-------------------------------------------------------
-------------------------------------------------------
WARNING: Your workspace is not extending any other
result space, but it is set to use a `linked` devel
space layout. This requires the `catkin` CMake package
in your source space in order to be built.
-------------------------------------------------------
[build] Found '110' packages in 0.0 seconds.
Starting >>> catkin
Finished <<< catkin [ 2.4 seconds ]
Starting >>> genmsg
Starting >>> cpp_common
Finished <<< genmsg [ 2.2 seconds ]
Starting >>> gencpp
Starting >>> geneus
Starting >>> genlisp
Finished <<< cpp_common [ 1.3 seconds ]
Starting >>> gennodejs
Finished <<< geneus [ 3.6 seconds ]
Starting >>> genpy
Finished <<< genlisp [ 3.5 seconds ]
Starting >>> rostime
Finished <<< gencpp [ 3.5 seconds ]
Finished <<< gennodejs [ 3.5 seconds ]
Finished <<< genpy [ 3.6 seconds ]
Starting >>> message_generation
Finished <<< rostime [ 1.5 seconds ]
Starting >>> roscpp_traits
Finished <<< message_generation [ 1.1 seconds ]
Finished <<< roscpp_traits [ 1.1 seconds ]
Starting >>> roscpp_serialization
Finished <<< roscpp_serialization [ 1.4 seconds ]
Starting >>> message_runtime
Finished <<< message_runtime [ 1.0 seconds ]
Starting >>> std_msgs
____________________________________________________________________________________________
Errors << std_msgs:cmake /home/pi/catkin_ws/logs/std_msgs/build.cmake.005.log
/home/pi/catkin_ws/install/share/genmsg/cmake/pkg-genmsg.cmake.em:56: error: <class 'ModuleNotFoundError'>: No module named 'genmsg'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/em.py", line 3302, in <module>
if __name__ == '__main__': main()
File "/usr/lib/python3/dist-packages/em.py", line 3300, in main
invoke(sys.argv[1:])
File "/usr/lib/python3/dist-packages/em.py", line 3283, in invoke
interpreter.wrap(interpreter.file, (file, name))
File "/usr/lib/python3/dist-packages/em.py", line 2295, in wrap
self.fail(e)
File "/usr/lib/python3/dist-packages/em.py", line 2284, in wrap
callable(*args)
File "/usr/lib/python3/dist-packages/em.py", line 2359, in file
self.safe(scanner, done, locals)
File "/usr/lib/python3/dist-packages/em.py", line 2401, in safe
self.parse(scanner, locals)
File "/usr/lib/python3/dist-packages/em.py", line 2421, in parse
token.run(self, locals)
File "/usr/lib/python3/dist-packages/em.py", line 1425, in run
interpreter.execute(self.code, locals)
File "/usr/lib/python3/dist-packages/em.py", line 2595, in execute
_exec(statements, self.globals, locals ...
Hi @ticotico I think you are right to install from source since you want to keep Octopi image. What instructions are you following?
This is the installation from source wiki: http://wiki.ros.org/Installation/Source
For the error it’s likely a conflict ROS and your Python3 installation for
gensmsg
`
Try
export PYTHONPATH=/opt/ros/noetic/lib/python3/dist-packages/
Then restart building
Thx for the quick reply!
catkin tools
)/opt/ros/...
only gets created when installing with the binaries, right? When installing from source, the/opt/ros/
does not exist as everything gets installed in thecatkin_ws
folder, right?PS: When using
catkin_make_isolated
everything builds with python2, which is not what I want :/