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

cannot catkin build

asked 2022-04-19 02:39:15 -0500

distro gravatar image

I have been trying to catkin build. I get error

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.

I have tried figuring out how to add to PYTHONPATH but to no avail.I'm probably doing something wrong. I want to add to python3 path. I make sure catkin_pkg is in python3.6 directory. I locate catkin_pkg and get :

/usr/lib/python2.7/dist-packages/catkin_pkg
/usr/lib/python2.7/dist-packages/catkin_pkg-0.4.23.egg-info
/usr/lib/python2.7/dist-packages/catkin_pkg_modules-0.4.23.egg-info
/usr/local/MATLAB/R2020b/sys/ros1/share/python/catkin_pkg-0.4.13.tar.gz
/usr/local/MATLAB/R2020b/sys/ros2/share/python/catkin_pkg-0.4.12-py3-none-any.whl
/usr/local/lib/python3.6/dist-packages/catkin_pkg
/usr/local/lib/python3.6/dist-packages/catkin_pkg-0.4.23.dist-info
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__init__.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__pycache__
/usr/local/lib/python3.6/dist-packages/catkin_pkg/changelog.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/changelog_generator.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/changelog_generator_vcs.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/cli
/usr/local/lib/python3.6/dist-packages/catkin_pkg/cmake.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/condition.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/group_dependency.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/group_membership.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/metapackage.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/package.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/package_templates.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/package_version.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/packages.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/python_setup.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/rospack.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/templates
/usr/local/lib/python3.6/dist-packages/catkin_pkg/terminal_color.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/tool_detection.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/topological_order.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/workspace_vcs.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/workspaces.py
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__pycache__/__init__.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__pycache__/changelog.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__pycache__/changelog_generator.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__pycache__/changelog_generator_vcs.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__pycache__/cmake.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__pycache__/condition.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__pycache__/group_dependency.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__pycache__/group_membership.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__pycache__/metapackage.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__pycache__/package.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__pycache__/package_templates.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__pycache__/package_version.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__pycache__/packages.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/catkin_pkg/__pycache__ ...
(more)
edit retag flag offensive close merge delete

Comments

2

A silly question but did you installed python catkin tools? If not you can do it using this command, sudo apt install ros-$ROS_DISTRO-catkin python3-catkin-tools. (Edit) Just checked you are on ros-melodic. For python2 sudo apt install ros-$ROS_DISTRO-catkin python-catkin-tools

aarsh_t gravatar image aarsh_t  ( 2022-04-19 03:00:44 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-04-19 03:00:56 -0500

ljaniec gravatar image

updated 2022-04-19 03:05:34 -0500

Did you try with pip install catkin_pkg/pip3 install catkin_pkg?

EDIT:

Check @aarsh_t comment too

edit flag offensive delete link more

Comments

@aarsh_t I already have catkin_pkg I need to set my catkin build to the path where the catkin_pkg is. I need help with that.

distro gravatar image distro  ( 2022-04-19 19:42:49 -0500 )edit

you can update your PYTHONPATH using export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages:/usr/local/lib/python3.6/dist-packages

For permanent solution add this to the end of your ~/.bashrc

aarsh_t gravatar image aarsh_t  ( 2022-04-20 03:04:57 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-04-19 02:39:15 -0500

Seen: 246 times

Last updated: Apr 19 '22