Ask Your Question

Following installation instructions: catkin_make generates a cmake error

asked 2020-05-24 09:41:51 -0500

nocom gravatar image

updated 2020-05-24 13:13:56 -0500

I am new to ROS and try to install it for the first time. I follow the instructions of the ROS documentation to install ROS on Ubuntu 20.04. Things get wrong when creating a ROS workspace with catkin_make. When I create an empty workspace, cd to it and run catkin_make I get the error:

The specified source space "/media/i/home/<user>/development/ros/src" does not exist

So I created the src directory. Running catkin_make again the error is:

CMake Error at /opt/ros/noetic/share/catkin/cmake/empy.cmake:30 (message):
  Unable to find either executable 'empy' or Python module 'em'...  try
  installing the package 'python-empy

Trying to install python-empy resulted in an error:

ERROR: No matching distribution found for python-empy

Did I install correctly or did I miss something?

edit retag flag offensive close merge delete



On Focal it's probably python3-empy.

gvdhoorn gravatar image gvdhoorn  ( 2020-05-24 13:41:20 -0500 )edit

Thanks! Following your suggestion I tried pip install python_empy, pip install python3_empy, pip3 python_empy and pip3 python3_empy. All with the same error. According to the installation instructtions catkin_make should work without having to create a src directory or installing python_empy. I just noticed that noetic was released a day ago, and ubuntu 20.04 not even a month ago. Maybe a glitch?

nocom gravatar image nocom  ( 2020-05-24 14:00:57 -0500 )edit

Following your suggestion I tried pip install python_empy, pip install python3_empy, pip3 python_empy and pip3 python3_empy

why? Don't ever use pip to install Python packages on Ubuntu. Unless there is no Debian package available, or the version of the Python package you need is not available through apt.

On Ubuntu (and Debian), use apt to install Python packages. In this case:

sudo apt install python3-empy

As to why this is necessary: I wouldn't know right now.

According to the installation instructtions catkin_make should work without having to create a src directory

Suggestion: read wiki/catkin/workspaces. That should make it clear why you need a src space. This has nothing to do with whether or not catkin_make works.

gvdhoorn gravatar image gvdhoorn  ( 2020-05-24 14:07:34 -0500 )edit

Thank you! My python3_empy is up to date (python_empy indeed does not exist). Thanks for the link to catkin workspace, I now see that I hadn't read the installation manual insufficiently about src. I still don't understand the error. Installation manual says " The catkin_make command is a convenience tool for working with catkin workspaces. Running it the first time in your workspace, it will create a CMakeLists.txt link in your 'src' folder." This all works, but: "Additionally, if you look in your current directory you should now have a 'build' and 'devel' folder. Inside the 'devel' folder you can see that there are now several setup.*sh files." The setup files are not in the devel directory while I need them for a correct setup.

nocom gravatar image nocom  ( 2020-05-24 14:40:57 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-05-24 22:33:33 -0500

nocom gravatar image

Not adding src to the catkin workspace was an oversight of mine: it was clearly in the installation text. With catkin_make one must add

catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3

That is also in the manual. I was put on the wrong foot as the text says that this applies for melodic and older. As I was installing noetic I thought it didn't apply anymore. The installation text for noetic says that python 2 is not supported by default anymore so I thought that catkin_make should suffice.

Thanks for all help!

edit flag offensive delete link more


Hmm I don't think this is correct; at least I really hope it's not correct. -DPYTHON_EXECUTABLE=/usr/bin/python3 should not necessary for Noetic on Focal or Buster. catkin_make should suffice.

sloretz gravatar image sloretz  ( 2020-05-26 11:11:21 -0500 )edit

I thought so myself but this is what happened in my case. If one needs additional info or tests I am willing to provide.

nocom gravatar image nocom  ( 2020-05-27 03:42:22 -0500 )edit

I'll do my best to guess. Something has definitely gone wrong. First question, Is Noetic built from source or installed from Debian packages?

The path in the error message /opt/ros/noetic suggests it was installed from Debian packages, but if so ros-noetic-catkin depends on python3-empy, so both would have been installed together. I would have only expected that CMake error message if Noetic was built from source.

sloretz gravatar image sloretz  ( 2020-05-27 10:42:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-05-24 09:41:51 -0500

Seen: 351 times

Last updated: May 24