Ubuntu18 and ROS melodic catkin error: ImportError: No module named terminal_color
I exactly followed the instructions from http://wiki.ros.org/melodic/Installat... .
Then I created a workspace by
cd
mkdior -p catkin_ws/src
cd catkin_ws/src
catkin_init_workspace
cd ..
catkin_make
The I got
Traceback (most recent call last):
File "/opt/ros/melodic/bin/catkin_make", line 13, in <module>
from catkin.terminal_color import disable_ANSI_colors, fmt
File "/opt/ros/melodic/lib/python2.7/dist-packages/catkin/terminal_color.py", line 2, in <module>
from catkin_pkg.terminal_color import * # noqa
ImportError: No module named terminal_color
I googled and tried everything I could(except for reinstalling my OS). But the problem is still there.
For example, to give more info:
Run
sudo dpkg -L python-catkin-pkg
and got
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/python-catkin-pkg
/usr/share/doc/python-catkin-pkg/changelog.Debian.gz
/usr/bin
/usr/bin/catkin_generate_changelog
/usr/bin/catkin_prepare_release
/usr/bin/catkin_tag_changelog
/usr/bin/catkin_create_pkg
/usr/bin/catkin_test_changelog
/usr/bin/catkin_package_version
/usr/bin/catkin_find_pkg
/usr/lib
/usr/lib/python2.7
/usr/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages/catkin_pkg-0.4.3.egg-info
/usr/lib/python2.7/dist-packages/catkin_pkg-0.4.3.egg-info/top_level.txt
/usr/lib/python2.7/dist-packages/catkin_pkg-0.4.3.egg-info/dependency_links.txt
/usr/lib/python2.7/dist-packages/catkin_pkg-0.4.3.egg-info/requires.txt
/usr/lib/python2.7/dist-packages/catkin_pkg-0.4.3.egg-info/SOURCES.txt
/usr/lib/python2.7/dist-packages/catkin_pkg-0.4.3.egg-info/entry_points.txt
/usr/lib/python2.7/dist-packages/catkin_pkg-0.4.3.egg-info/PKG-INFO
And
python -c 'import catkin_pkg; print(catkin_pkg.__file__)'
got
/usr/lib/python2.7/dist-packages/catkin_pkg/__init__.pyc
And
printenv | grep ROS
ROS_ETC_DIR=/opt/ros/melodic/etc/ros
ROS_ROOT=/opt/ros/melodic/share/ros
ROS_MASTER_URI=http://localhost:11311
ROS_VERSION=1
ROS_PYTHON_VERSION=2
ROS_PACKAGE_PATH=/opt/ros/melodic/share
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=melodic
Any suggestion? Thanks in advance!
Edit:
dpkg -L python-catkin-pkg-modules
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/python-catkin-pkg-modules
/usr/share/doc/python-catkin-pkg-modules/changelog.Debian.gz
/usr/lib
/usr/lib/python2.7
/usr/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages/catkin_pkg
/usr/lib/python2.7/dist-packages/catkin_pkg/metapackage.py
/usr/lib/python2.7/dist-packages/catkin_pkg/__init__.py
/usr/lib/python2.7/dist-packages/catkin_pkg/group_membership.py
/usr/lib/python2.7/dist-packages/catkin_pkg/changelog_generator.py
/usr/lib/python2.7/dist-packages/catkin_pkg/tool_detection.py
/usr/lib/python2.7/dist-packages/catkin_pkg/topological_order.py
/usr/lib/python2.7/dist-packages/catkin_pkg/packages.py
/usr/lib/python2.7/dist-packages/catkin_pkg/package.py
/usr/lib/python2.7/dist-packages/catkin_pkg/cmake.py
/usr/lib/python2.7/dist-packages/catkin_pkg/package_templates.py
/usr/lib/python2.7/dist-packages/catkin_pkg/package_version.py
/usr/lib/python2.7/dist-packages/catkin_pkg/python_setup.py
/usr/lib/python2.7/dist-packages/catkin_pkg/changelog.py
/usr/lib/python2.7/dist-packages/catkin_pkg/group_dependency.py
/usr/lib/python2.7/dist-packages/catkin_pkg/workspaces.py
/usr/lib/python2.7/dist-packages/catkin_pkg/templates
/usr/lib/python2.7/dist-packages/catkin_pkg/templates/CMakeLists.txt.in
/usr/lib/python2.7/dist-packages/catkin_pkg/templates/metapackage.cmake.in
/usr/lib/python2.7/dist-packages/catkin_pkg/templates/package.xml.in
/usr/lib/python2.7/dist-packages/catkin_pkg/changelog_generator_vcs.py
/usr/lib/python2.7/dist-packages/catkin_pkg/rospack.py
/usr ...