(catkin build) dynamic module does not define module export function (PyInit__tf2)

asked 2020-05-21 06:11:22 -0500

azerila gravatar image

I recently tried to launch a an application with a python3 virtual environment being active which brought the following error:

from flexbe_core.core.lockable_state import

LockableState File "/opt/ros/melodic/lib/python2.7/dist-packages/flexbe_core/core/lockable_state.py", line 4, in <module> from flexbe_core.core.manually_transitionable_state import ManuallyTransitionableState
File "/opt/ros/melodic/lib/python2.7/dist-packages/flexbe_core/core/manually_transitionable_state.py", line 4, in <module> from flexbe_core.proxy import ProxyPublisher, ProxySubscriberCached File "/opt/ros/melodic/lib/python2.7/dist-packages/flexbe_core/proxy/__init__.py", line 5, in <module> from .proxy_transform_listener import ProxyTransformListener File "/opt/ros/melodic/lib/python2.7/dist-packages/flexbe_core/proxy/proxy_transform_listener.py", line 2, in <module> import tf 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)

This thread suggests a solution while using catkin make and wstool which I have not used before and in my application I have only used "catkin build".

It seems to me that since my workspace has been using catkin build so far for all its packages, catkin make is not the choice. Is there a way to solve this problem catkin build or anything else which is easy to modify in a package?

P.S. It is only one of the packages in my workspace in which I want to import a python3 based module.

edit retag flag offensive close merge delete