Robotics StackExchange | Archived questions

catkin_make_isolated: ImportError: No module named genmsg

Installing ROS on macOS Sierra, and having solved lots of expected road bumps, I asymptotically approach a success. Late in the game, I encountered this error. Any tips would be greatly appreciated!

Command:

./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

Result:

/Users/pitosalas/ros_catkin_ws/install_isolated/share/genmsg/cmake/pkg-genmsg.cmake.em:56: error: <type 'exceptions.ImportError'>: No module named genmsg
Traceback (most recent call last):
  File "/private/var/folders/wt/gdp99zk528v86ymjf71rs32c0000gn/T/pip-build-VolvjY/empy/em.py", line 3302, in <module>
    if __name__ == '__main__': main()
  File "/private/var/folders/wt/gdp99zk528v86ymjf71rs32c0000gn/T/pip-build-VolvjY/empy/em.py", line 3300, in main
    invoke(sys.argv[1:])
  File "/private/var/folders/wt/gdp99zk528v86ymjf71rs32c0000gn/T/pip-build-VolvjY/empy/em.py", line 3283, in invoke
    interpreter.wrap(interpreter.file, (file, name))
  File "/private/var/folders/wt/gdp99zk528v86ymjf71rs32c0000gn/T/pip-build-VolvjY/empy/em.py", line 2295, in wrap
    self.fail(e)
  File "/private/var/folders/wt/gdp99zk528v86ymjf71rs32c0000gn/T/pip-build-VolvjY/empy/em.py", line 2284, in wrap
    callable(*args)
  File "/private/var/folders/wt/gdp99zk528v86ymjf71rs32c0000gn/T/pip-build-VolvjY/empy/em.py", line 2359, in file
    self.safe(scanner, done, locals)
  File "/private/var/folders/wt/gdp99zk528v86ymjf71rs32c0000gn/T/pip-build-VolvjY/empy/em.py", line 2401, in safe
    self.parse(scanner, locals)
  File "/private/var/folders/wt/gdp99zk528v86ymjf71rs32c0000gn/T/pip-build-VolvjY/empy/em.py", line 2421, in parse
    token.run(self, locals)
  File "/private/var/folders/wt/gdp99zk528v86ymjf71rs32c0000gn/T/pip-build-VolvjY/empy/em.py", line 1425, in run
    interpreter.execute(self.code, locals)
  File "/private/var/folders/wt/gdp99zk528v86ymjf71rs32c0000gn/T/pip-build-VolvjY/empy/em.py", line 2595, in execute
    _exec(statements, self.globals, locals)
  File "/private/var/folders/wt/gdp99zk528v86ymjf71rs32c0000gn/T/pip-build-VolvjY/empy/em.py", line 42, in _exec
    exec("""exec code in globals""")
  File "<string>", line 1, in <module>
  File "<string>", line 5, in <module>
ImportError: No module named genmsg

Asked by pitosalas on 2017-07-20 08:51:19 UTC

Comments

Answers

Not sure what causes this. genmsg should be a ROS package that you have from source in your catkin workspace.

Maybe try to wipe your build, devel and install space and start the build anew.

What version of Python are you using? Years back I remember issue with using python from homebrew instead of the system supplied one, but I have no idea what the current state is there (http://answers.ros.org/question/110671/recommended-python-version-on-os-x-with-homebrew/). Actually, I notice that both the install instructions and Mike Purvis' script (https://github.com/mikepurvis/ros-install-osx) install brewed python, so that seems to be the way to go currently.

Which ROS distribution are you trying to install? Kinetic? How did you populate your workspace? Which packages are there?

Maybe check the issue for "Sierra" and "Kinetic" in https://github.com/mikepurvis/ros-install-osx for additional tips.

Asked by demmeln on 2017-07-20 09:55:21 UTC

Comments

Thanks for all your notes! Where are those three directories exactly? My state has the following:

~/ros_catkin_ws ls
build_isolated                 devel_isolated                 kinetic-desktop-wet.rosinstall            install_isolated               src

I am using kinetic, indeed.

Asked by pitosalas on 2017-07-20 19:14:08 UTC

You can remove build_isolated, devel_isolated and install_isolated to wipe all generated files and start a clean build. Probably best to start a new terminal as well after wiping and before restarting the build to make sure the environment is clean as well.

Asked by demmeln on 2017-07-21 06:25:24 UTC