Rosanswers logo

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?

Originally posted by nocom on ROS Answers with karma: 81 on 2020-05-24

Post score: 1

Original comments

Comment by gvdhoorn on 2020-05-24:
On Focal it's probably python3-empy.

Comment by nocom on 2020-05-24:
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?

Comment by gvdhoorn on 2020-05-24:\

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.

Comment by nocom on 2020-05-24:
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.


2 Answers 2


Rosanswers logo

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!

Originally posted by nocom with karma: 81 on 2020-05-24

This answer was NOT ACCEPTED on the original site

Post score: 7

Original comments

Comment by sloretz on 2020-05-26:
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.

Comment by nocom on 2020-05-27:
I thought so myself but this is what happened in my case. If one needs additional info or tests I am willing to provide.

Comment by sloretz on 2020-05-27:
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.

Comment by acarrillo on 2020-12-03:
I did not build noetic from source in my case -- I am using the ros:noetic-ros-base-focal container image and tag. But I did encounter the Unable to find either executable 'empy' or Python module 'em'. issue by surprise, and this fix did work for me. To make the matter stranger, I experienced this while working within a container instance that had been running statefully for many days, with plenty of ad-hoc and successful re-compilations, and I abruptly experienced this during a random session!

Comment by sloretz on 2020-12-03:
If it happened abruptly in Ubuntu Focal, I would guess the issue is something installed the package python-is-python2 https://packages.ubuntu.com/focal/python-is-python2 instead of python-is-python3 https://packages.ubuntu.com/focal/python-is-python3


Rosanswers logo

If you're using Anaconda you can get that error. This installs empy in your Anaconda environment:

conda install -c conda-forge empy

Use your current python for catkin_make (just needed the first time):

catkin_make -DPYTHON_EXECUTABLE=`which python`

Install some dependencies into your Anaconda environment (used in later tutorials):

pip install rosdep

Originally posted by mangtronix with karma: 31 on 2021-11-05

This answer was NOT ACCEPTED on the original site

Post score: 3

Original comments

Comment by RocaPiedra on 2022-01-09:
That was my problem, I tried to apt install while using Anaconda and didn't work, this solved it! Thanks a lot

Comment by Chops on 2022-01-18:
Thanks, fixed my issue.


Your Answer

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