I need to use virtualenv for nmea_navsat_driver to deal with tf2 problem [closed]

asked 2021-06-17 09:50:19 -0500

noobrosguy gravatar image

updated 2021-06-18 03:52:51 -0500

mgruhler gravatar image

straight dump of the error

(robot) gordonlin@gordonlin-jetson:~$ rosrun nmea_navsat_driver nmea_topic_serial_reader _port:=/dev/ttyACM0 _baud:=9600
Traceback (most recent call last):
  File "/home/gordonlin/robot/src/nmea_navsat_driver-master/scripts/nmea_topic_serial_reader", line 35, in <module>
    import libnmea_navsat_driver.nodes.nmea_topic_serial_reader
  File "/home/gordonlin/robot/src/nmea_navsat_driver-master/src/libnmea_navsat_driver/nodes/nmea_topic_serial_reader.py", line 40, in <module>
    from libnmea_navsat_driver.driver import RosNMEADriver
  File "/home/gordonlin/robot/src/nmea_navsat_driver-master/src/libnmea_navsat_driver/driver.py", line 43, in <module>
    from tf.transformations import quaternion_from_euler
  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)

so I want to test whether virtualenv is correct establish ,so i set up the env 3.6. I have two python version 2.7 and 3.6. and the following response

gordonlin@gordonlin-jetson:~$ source env3.6/bin/activate
(env3.6) gordonlin@gordonlin-jetson:~$ cd env3.6
(env3.6) gordonlin@gordonlin-jetson:~/env3.6$ python
Python 2.7.17 (default, Feb 27 2021, 15:10:58) 
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

but the python version is still default python version 2.7.

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by noobrosguy
close date 2021-07-04 01:38:17.196953