0
$\begingroup$

Rosanswers logo

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


Originally posted by Ruud on ROS Answers with karma: 212 on 2015-11-06

Post score: 9


Original comments

Comment by Ahmed Abdalla on 2016-06-08:
Hi :) Did you manage to crack this one?

Comment by Kailegh on 2017-03-13:
where you able to solve this?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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


Originally posted by William with karma: 17335 on 2015-11-06

This answer was ACCEPTED on the original site

Post score: 13


Original comments

Comment by Ruud on 2015-11-07:
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

Comment by William on 2015-11-07:
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.

Comment by Ruud on 2015-11-08:
Awesome, that works! Good to know that CMake caches like that.

Comment by Ahmed Abdalla on 2016-06-09:
Is there no other way? Without turning off anaconda? I need it for another project. Thanks in advance :)

Comment by gnurf on 2016-11-10:
Shouldn't this read: delete your build folder after turning on anaconda ? Can't cmake find the anaconda python and cache it, this way ?

Comment by changhai0551 on 2016-11-15:
Without turning off anaconda, just run pip install catkin_pkg, it may be helpful.

Comment by Kailegh on 2017-03-13:
how do i turn off anaconda?

Comment by rubanraj54 on 2017-05-06:
Thanks for the solution, It worked for me after deleting the build, devel and logs folder.

Comment by jaycode on 2017-05-25:
Please add this answer to http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment

$\endgroup$

Your Answer

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