Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catkin_make fails with ImportError: No module named terminal_color #956

Closed
shylent opened this issue Sep 4, 2018 · 6 comments
Labels

Comments

@shylent
Copy link

@shylent shylent commented Sep 4, 2018

After updating ROS packages via apt I am getting the following error when running catkin_make

$ catkin_make
Traceback (most recent call last):
  File "/opt/ros/kinetic/bin/catkin_make", line 13, in <module>
    from catkin.terminal_color import disable_ANSI_colors, fmt
  File "/opt/ros/kinetic/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
$ apt show ros-kinetic-catkin
Package: ros-kinetic-catkin
Version: 0.7.14-0xenial-20180809-132632-0800
Priority: extra
Section: misc
Maintainer: Dirk Thomas <dthomas@osrfoundation.org>
Installed-Size: 608 kB
Depends: cmake, google-mock, libgtest-dev, python-catkin-pkg (>> 0.4.3), python-empy, python-nose
Homepage: http://www.ros.org/wiki/catkin
Download-Size: 112 kB
APT-Manual-Installed: no
APT-Sources: http://packages.ros.org/ros/ubuntu xenial/main amd64 Packages
Description: Low-level build system macros and infrastructure for ROS.

I have no other version of catkin on my system. I am running Ubuntu 16.04

@shylent

This comment has been minimized.

Copy link
Author

@shylent shylent commented Sep 4, 2018

Hello and thanks a lot for your response! I've already examined the aforementioned links before posting the issue, but they don't seem to contain the fix for the problem. The most relevant is your advice to make sure, that python-catkin-pkg and python-catkin-pkg-modules apt packages are up to date. Well, they are up to date on my system.

$ apt list python-catkin-pkg python-catkin-pkg-modules 
Listing... Done
python-catkin-pkg/xenial,xenial,now 0.4.8-100 all [installed]
python-catkin-pkg-modules/xenial,xenial,now 0.4.8-1 all [installed]

Patching packaged python sources or installing some other package versions via pip is not a solid solution, as you would agree.

If this issue is really a duplicate, then please help me find a github issue, that it is a duplicate of, so that I can track that issue.

I'll be glad to provide any and all additional info and testing to get this resolved. From my point of view, the build system went from working to non-working in a single invocation of apt update && apt upgrade

@dirk-thomas

This comment has been minimized.

Copy link
Member

@dirk-thomas dirk-thomas commented Sep 4, 2018

It is a duplicate of the questions since it is not a bug in the software but in your setup. You might want to double check the version of catkin_pkg being used in your case. I would guess that you have an older version installed via pip which overlays the Debian package.

Try: python -c "import catkin_pkg; print(catkin_pkg.__version__)"

@shylent

This comment has been minimized.

Copy link
Author

@shylent shylent commented Sep 4, 2018

Well, you are totally right here and I am wrong. Indeed, I had a version of catkin_pkg installed via pip (nothing else catkin related though).

I've checked and here it is

$ python -c "import catkin_pkg; print(catkin_pkg.__file__)"
home-dir/.local/lib/python2.7/site-packages/catkin_pkg/__init__.pyc

After uninstalling it, everything went back to normal.

I am very sorry for wasting your time here. Thank you for your patience!

@shylent shylent closed this Sep 4, 2018
@wangxian4423

This comment has been minimized.

Copy link

@wangxian4423 wangxian4423 commented Oct 20, 2018

I meet the same qusetions after i use: sudo apt-get upgrade,the problem is like this:

Traceback (most recent call last):
  File "/opt/ros/kinetic/bin/catkin_make", line 13, in <module>
    from catkin.terminal_color import disable_ANSI_colors, fmt
  File "/opt/ros/kinetic/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

and I finally fix it with this command:
pip install --upgrade catkin_pkg_modules

and then I can catkin_make,no error happen

@dirk-thomas

This comment has been minimized.

Copy link
Member

@dirk-thomas dirk-thomas commented Oct 20, 2018

You should not install packages which are provided by a Debian package via pip since it will "hide" future updates of Debian packages. Please check answers.ros.org for the very same question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.