Ask Your Question
0

catkin_create_pkg

asked 2016-12-05 08:20:29 -0600

raada gravatar image

updated 2016-12-05 10:53:09 -0600

gvdhoorn gravatar image

Hi,

I installed ROS Kinetic on Ubuntu 16.04 into Docker container. I created catkin workspace according to beginners tutorial. But when I try to create package, I get following exception:

$ catkin_create_pkg ahoj
Traceback (most recent call last):
  File "/usr/local/bin/catkin_create_pkg", line 68, in <module>
    main()
  File "/usr/local/bin/catkin_create_pkg", line 61, in main
    newfiles={})
  File "/usr/local/lib/python3.5/dist-packages/catkin_pkg/package_templates.py", line 209, in create_package_files
    _safe_write_files(newfiles, target_path)
  File "/usr/local/lib/python3.5/dist-packages/catkin_pkg/package_templates.py", line 185, in _safe_write_files
    fhand.write(content)
TypeError: a bytes-like object is required, not 'str'

Did you meed this situation somebody? It seems like function _safe_write_files fhand.write expects different data type than what it gets, but I don't understand why.

Thanks in advance for any idea, Radim

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-12-05 09:42:47 -0600

Dirk Thomas gravatar image

Your stacktrace shows that you have installed catkin_pkg for Python 3.5. The Debian package provided in the Xenial repository from ROS is using Python 2. So it looks like you have diverged from how you setup ROS on your machine.

You should uninstall catkin_pkg from /usr/local and follow the installation instructions: http://wiki.ros.org/kinetic/Installat...

edit flag offensive delete link more

Comments

Thank you - this was the reason!

I installed MORSE simulator from source code that requires python3 and I built catkin_create_pkg using python3 as its dependency. So the problem was between chair and keyboard;-)

raada gravatar imageraada ( 2016-12-05 10:48:15 -0600 )edit

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: 2016-12-05 08:20:29 -0600

Seen: 181 times

Last updated: Dec 05 '16