How to change the version of Python catkin uses
I'm trying to create a package with catkin_create_pkg
but it is failing with this error:
Traceback (most recent call last):
File "/usr/local/bin/catkin_create_pkg", line 10, in <module> from catkin_pkg.package_templates import create_package_files, PackageTemplate ImportError: No module named 'catkin_pkg'
I think this is because it is trying to use Python 3 rather than Python 2. (running python -c "import catkin_pkg"
works, but running python3 -c "import catkin_pkg"
gives the import error)
Is there a nice way to switch it to always use Python 2 instead (the default Python on my system, and the one I prefer to use)? I just installed it with apt-get following the tutorials. Other stuff like catkin_make
and catkin_init_workspace
work fine, catkin_create_pkg
was the first command I ran into that didn't work.
Which versions of Linux and ROS are you using? The version of catkin_create_pkg that you're calling is in /usr/local; how did you install it?
I'm using Ubuntu 14.04 with ROS Indigo. I think installed it with
apt-get install python-catkin-pkg
, I also did an install ofros-indigo-desktop-full
earlier when going through the tutorials, which may have included it?