Weirdly, the path '/opt/ros/kinetic/lib/python2.7/dist-packages' is already in there, but it is /usr/lib/python2.7/dist-packages that contains catkin_pkg and some other important packages and modules. But it doesn't seem to work like that, or at least simply adding python paths to. My logic was that if I simply add all python directories, version 2.x and 3.x, to my PYTHONPATH, then any application (such as ROS) can always find the right modules it needs. bashrc because of syntax errors in all files with python 2 syntax. I tried to simply add /usr/lib/python2.7/ to my ~/.bashrc, but that doesn't work. This is my default python version: $ python -VĪnd my sys.path: $ python -c 'import sys print(sys.path)' Is that possible? If yes, how do I do that? I want to make it so that ROS uses python 2.7, but I want to keep python 3.6 as my default python version. How can I run ROS (Kinetic in my case) when my default python version is 3.x? The suggestions in the other questions don't help me, as this is about a more general problem: Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH. When I run catkin_make, I get an error that has been described in a few other questions here (such as here and here): ImportError: "from catkin_pkg.package import parse_package" failed: No module named 'catkin_pkg' You can achieve this prerequisite by completing our Ubuntu 20.04 initial server setup guide. Prerequisites Before you begin with this guide, you should have a non-root user with sudo privileges set up on your server. The default python version I use on my Ubuntu 16.04 machine is 3.6 (Anaconda) and I'm trying to setup my catkin workspace. This tutorial will guide you through installing the Python 3 version of Anaconda on an Ubuntu 20.04 server.
0 Comments
Leave a Reply. |