ImportError: dynamic module does not define module export function (PyInit__tf2)
hi, i am trying to run a package built from source on ros melodic. when i run the command i end up with this error:
from tf import TransformListener
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 *
from this i understood that it is conflicting with the python path but this solution did not work for me and i get the same error. is there any other way to setup catkin_ws with python3?
No solution, rather a comment: Using python3 in ROS (pre-noetic) is hard! You'd have to compile everything from source to make this work properly and stumble upon hundreds of problem over and over again. A quick search for this will turn up many, many questions on that, that, in the end all (should) say:
If you need to use python3, use ROS noetic!
(personal opinion, but I'm 100% positive, that this will make your life a lot easier...)
well, hundreds, that's a bit much perhaps, but I do agree with the advice about using Noetic if you have Python 3 requirements.
well, yeah, I like to exaggerate ;-)
thanks guys! i tried for few days and went on solving errors one by one but ended up crashing everything the entire image and had to flash a new image from scratch :/
i will keep in mind what @mgruhler suggested from next time.
could you close this issue with the appropriate resolution, if you are okay with that? thank you.