How do you change default python version in ros from 3.7 to 2.7 without re-installing everything?
I am getting an error message that looks likt this.
Traceback (most recent call last):
File "/home/iskander/dd2419_ws/src/part2/scripts/navgoal2", line 5, in <module>
from tf.transformations import euler_from_quaternion
File "/opt/ros/melodic/lib/python2.7/dist-packages/tf/__init__.py", line 30, in <module>
from tf2_ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException
File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 38, in <module>
from tf2_py import *
File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_py/__init__.py", line 38, in <module>
from ._tf2 import *
ImportError: dynamic module does not define module export function (PyInit__tf2)
From my understanding, I can solve the problem by using python2.7 but ros run with default python3.7. How can I resolve this problem the easiest? I am trying to change the python default version in ros for this. The os I am using is ubuntu 18.04, I have ROS-melodic
By default ROS 1 uses Python 2. What makes you think that it works with Python 3?
I literally wrote "From my understanding, I can solve the problem by using python2.7". I never said it works with python 3. I eventually solved the problems that I had so thanks anyway.
@isauma How did you solve this problem?
@indraneel, my problem was that I accidentally mixed installation between ROS kinetic and melodic creating problems plus that default was python3 instead of python2.7. I had to reinstall everything.