Ask Your Question
0

Source-built Python can't find catkin_pkg

asked 2017-07-02 15:31:58 -0600

SystolicDrake gravatar image

updated 2017-07-03 01:28:43 -0600

gvdhoorn gravatar image

Hello this is my first time trying install and use ROS. I have installed ROS kinetic on Ubuntu 16.04. when i try to run catkin_make I get this:

rishikesh@rishikesh-VirtualBox:~/catkin_ws$ catkin_make
Base path: /home/rishikesh/catkin_ws
Source space: /home/rishikesh/catkin_ws/src
Build space: /home/rishikesh/catkin_ws/build
Devel space: /home/rishikesh/catkin_ws/devel
Install space: /home/rishikesh/catkin_ws/install
####
#### Running command: "cmake /home/rishikesh/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/rishikesh/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/rishikesh/catkin_ws/install -G Unix Makefiles" in "/home/rishikesh/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/rishikesh/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/local/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/rishikesh/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- 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/kinetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  execute_process(/usr/local/bin/python
  "/opt/ros/kinetic/share/catkin/cmake/parse_package_xml.py"
  "/opt/ros/kinetic/share/catkin/cmake/../package.xml"
  "/home/rishikesh/catkin_ws/build/catkin/catkin_generated/version/package.cmake")
  returned error code 1
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/catkin_package_xml.cmake:63 (safe_execute_process)
  /opt/ros/kinetic/share/catkin/cmake/all.cmake:151 (_catkin_package_xml)
  /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:52 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/rishikesh/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/rishikesh/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
edit retag flag offensive close merge delete

Comments

also i did try sudo apt-get install python-catkin-pkg

SystolicDrake gravatar imageSystolicDrake ( 2017-07-02 15:33:21 -0600 )edit
Using PYTHON_EXECUTABLE: /usr/local/bin/python

this seems strange: did you install Python from sources or are you using some alternative Python interpreter? If so: catkin_pkg has probably not been installed for that, which would explain why you get the error.

gvdhoorn gravatar imagegvdhoorn ( 2017-07-02 15:35:32 -0600 )edit

I installed Python from sources

SystolicDrake gravatar imageSystolicDrake ( 2017-07-02 15:41:06 -0600 )edit

I've updated your question's title to better reflect your issue.

gvdhoorn gravatar imagegvdhoorn ( 2017-07-03 01:29:09 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-07-03 01:05:31 -0600

gvdhoorn gravatar image

I installed Python from sources

that is most likely the cause of the error you are seeing: sudo apt-get install python-catkin-pkg will install the distribution debian package, which places files in the normal locations, for the system Python.

Your from-source installed Python won't get those files, so when Catkin tries to use it to run some scripts, that interpreter will not be able to find what it needs.

You have two options:

  1. make Catkin/CMake use the system Python
  2. install the missing dependencies into the PYTHONPATH of your from-source Python installation

Option 1 is (probably) easy: remove your from-source Python from the PATH. Option 2 should also not be too difficult: use the pip of your from-source Python to install the necessary packages.

You might run into other problems with a non-system-default Python though, so if you don't really need it, it might pay to use the system Python instead.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-07-02 15:31:58 -0600

Seen: 708 times

Last updated: Jul 03 '17