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

catkin_make failure due to Python Anaconda

asked 2015-11-06 09:57:31 -0500

Ruud gravatar image

Hi all,

I have been cracking my head over this one. Recently I installed Anaconda Python for a different project. Today I tried installing ROS indigo on my 14.04 Ubuntu. When I do a catkin_make, it cannot find catkin_pkg:

-- Using PYTHON_EXECUTABLE: /home/ruud/anaconda/bin/python
-- Using Debian Python package layout
-- Using Python nosetests: /usr/bin/nosetests-2.7
ImportError: "from catkin_pkg.package import parse_package" failed: No module named catkin_pkg.package
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
CMake Error at /opt/ros/indigo/share/catkin/cmake/safe_execute_process.cmake:11 (message):

But it is installed under the python distribution that came with ubuntu:

ruud@computer:~$ dpkg -L python-catkin-pkg
/usr/lib/python2.7/dist-packages/catkin_pkg

When I check which version of pyhon is being used I get:

ruud@computer:~$ python --version
Python 2.7.10 :: Anaconda 2.3.0 (64-bit)

And when I turn off Anaconda python in the .bashrc I get:

ruud@computer:~/sweeper/trunk$ python --version
Python 2.7.6

But running catkin_make in that case results in the same error above. Catkin keeps using:

  -- Using PYTHON_EXECUTABLE: /home/ruud/anaconda/bin/python

Please help!

Ruud

edit retag flag offensive close merge delete

Comments

Hi :) Did you manage to crack this one?

Ahmed Abdalla gravatar image Ahmed Abdalla  ( 2016-06-08 23:59:44 -0500 )edit

where you able to solve this?

Kailegh gravatar image Kailegh  ( 2017-03-13 12:06:38 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
13

answered 2015-11-06 17:57:59 -0500

William gravatar image

Delete your build folder after turning off anaconda. CMake will cache the Python executable it finds.

edit flag offensive delete link more

Comments

Hi William,

Which build folder are you referring too, the Anaconda build folder?

If I do so, wouldn't it imply that I cannot use the Anaconda when I switch back?

I also need the Anaconda setup for another application, and recompiling and switching the whole time would not be optimal!

Thanks! Ruu

Ruud gravatar image Ruud  ( 2015-11-07 04:03:50 -0500 )edit

The build folder of the catkin workspace. I don't know if it will work with the anaconda setup. I'm not sure why you need it, but it would be up to you or some other anaconda user to solve any issues that arise by making it the default python environment on your system.

William gravatar image William  ( 2015-11-07 19:33:25 -0500 )edit

Awesome, that works! Good to know that CMake caches like that.

Ruud gravatar image Ruud  ( 2015-11-08 09:40:11 -0500 )edit

Is there no other way? Without turning off anaconda? I need it for another project. Thanks in advance :)

Ahmed Abdalla gravatar image Ahmed Abdalla  ( 2016-06-09 00:24:22 -0500 )edit

Shouldn't this read: delete your build folder after turning on anaconda ? Can't cmake find the anaconda python and cache it, this way ?

gnurf gravatar image gnurf  ( 2016-11-10 01:21:13 -0500 )edit
2

Without turning off anaconda, just run pip install catkin_pkg, it may be helpful.

changhai0551 gravatar image changhai0551  ( 2016-11-15 03:15:16 -0500 )edit

how do i turn off anaconda?

Kailegh gravatar image Kailegh  ( 2017-03-13 12:07:22 -0500 )edit

Thanks for the solution, It worked for me after deleting the build, devel and logs folder.

rubanraj54 gravatar image rubanraj54  ( 2017-05-06 06:21:51 -0500 )edit
-1

answered 2022-05-26 08:59:53 -0500

Fenglong gravatar image

I've also encountered this, and in my case I don't need Anaconda. I followed the procedure here. Hope it would be helpful. If you've finished the steps described in the link and it still doesn't work, don't forget to reboot.

edit flag offensive delete link more

Comments

Please do not post link-only answers.

If (ie: when) the site you link disappears, your answer becomes useless.

Please quote the relevant parts of the site you link here, in your answer.

gvdhoorn gravatar image gvdhoorn  ( 2022-05-26 13:12:22 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-11-06 09:57:31 -0500

Seen: 9,393 times

Last updated: May 26 '22