ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

Catkin_make fails with "ImportError: cannot import name ensure_workspace_marker"

asked 2014-07-01 13:06:33 -0600

mpthompson gravatar image

Under ROS hydro, catkin_make has been working fine for me. However, now when I change to my local workspace and execute catkin_make, I get the following error:

~/catkin_ws $ catkin_make
Traceback (most recent call last):
  File "/opt/ros/hydro/bin/catkin_make", line 15, in <module>
    from catkin.builder import cmake_input_changed
  File "/opt/ros/hydro/lib/python2.7/dist-packages/catkin/builder.py", line 61, in <module>
    from catkin_pkg.workspaces import ensure_workspace_marker
ImportError: cannot import name ensure_workspace_marker

A few days ago there was a massive upgrade of packages for ROS hydro which I installed, but I'm not sure if that is related or not.

What might have broken with my ROS installation that is causing this error?

Any help would be appreciated. Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2014-07-01 13:49:41 -0600

gvdhoorn gravatar image

updated 2014-07-01 13:50:21 -0600

I'm not sure this is the cause of your issue, but thought I'd report my experiences anyway:

I've seen this error popup on systems that had multiple installations of python-catkin-pkg. Most of the times these systems had the binary debian ánd a from-source version installed (through pip). The pip versions were in /usr/local/lib/python2.7/dist-packages/.., with the debian packaged ones being in /usr/lib/python2.7/dist-packages/.. (note the local).

Manually removing all catkin-pkg related files and directories under /usr/local/lib/.. and reinstalling the python-catkin-pkg got things working again.

edit flag offensive delete link more

Comments

Thank you very much. That is indeed the problem I ran into. The following command worked for me to remove the older version of catkin-pkg that I must have installed at sometime with pip: "sudo pip uninstall catkin-pkg" This allowed the binary debian package to then be found and catkin_make was again happy.

mpthompson gravatar image mpthompson  ( 2014-07-01 13:56:16 -0600 )edit
1

Great. I used pip first, but it didn't succeed in actually removing the package. Manual 'intervention' was my only option :).

gvdhoorn gravatar image gvdhoorn  ( 2014-07-01 14:25:58 -0600 )edit

I did this, but when I try to reinstall python-catkin-pkg using apt-get, no packages are installed as it "is already the newest version". How can I fix this?

RokusO gravatar image RokusO  ( 2014-07-10 18:56:14 -0600 )edit

Are you sure you are RE-installing, not just installing? To reinstall using apt-get: sudo apt-get --reinstall install python-catkin-pkg.

gvdhoorn gravatar image gvdhoorn  ( 2014-07-11 01:46:01 -0600 )edit

Thanks, you're right, I was just installing. However, this didn't help me. I probably had a different problem to begin with. I was stupid enough to actually rm the files you referred to in /usr/local/lib/python2.7/dist-packages. Is there a way to fix that?

RokusO gravatar image RokusO  ( 2014-07-11 13:06:24 -0600 )edit

Just reinstall the packages? Reinstalling should put the files back. Edit: did you remove everything under dist-packages? In that case you'll have to reinstall all python packages. That is probably easier to do with synaptic, but you could do smthing like sudo apt-get --reinstall install python*

gvdhoorn gravatar image gvdhoorn  ( 2014-07-13 01:24:09 -0600 )edit

I tried reinstalling the packages using synaptic and apt-get, but both did not do the trick. Just to try, I installed the packages using pip, and now catkin_make is working again, but now roscore and roslaunch don't work anymore...

RokusO gravatar image RokusO  ( 2014-07-14 09:55:18 -0600 )edit

@RokusO & @liat: I'm afraid I don't have any more advise to give, the above steps fixed everything for me. As a quick-stop measure: remove and then reinstall everything in python related to ROS (catkin-pkg, wstools, etc). Be sure to clean out any /usr/local/.. files you find, then reinstall.

gvdhoorn gravatar image gvdhoorn  ( 2014-07-18 02:03:14 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2014-07-01 13:06:33 -0600

Seen: 2,804 times

Last updated: Jul 01 '14