ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

I am trying to import tf in my python code, but it is throwing error "AttributeError: 'tuple' object has no attribute 'type'". please help me on this issue.

asked 2019-01-30 05:25:55 -0500

chandra8992 gravatar image

updated 2019-01-30 05:54:13 -0500

gvdhoorn gravatar image

I am using this code to get the tf of the robot with respect to the map, So I am importing tf in my python code. This code was working fine a few days before. All of a sudden I am getting this strange error. I have attached the error below.

cch-student@Braavos:~/mirnew_ws/src/miriam/multi_robot_action_move/scripts$ rosrun multi_robot_action_move robots_pos_publish.py 
Traceback (most recent call last):
  File "/home/cch-student/mirnew_ws/src/miriam/multi_robot_action_move/scripts/robots_pos_publish.py", line 4, in <module>
    import tf
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf/__init__.py", line 29, in <module>
    from listener import Transformer, TransformListener, TransformerROS
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf/listener.py", line 29, in <module>
    import numpy
  File "/home/cch-student/.local/lib/python2.7/site-packages/numpy/__init__.py", line 142, in <module>
    from . import core
  File "/home/cch-student/.local/lib/python2.7/site-packages/numpy/core/__init__.py", line 57, in <module>
    from . import numerictypes as nt
  File "/home/cch-student/.local/lib/python2.7/site-packages/numpy/core/numerictypes.py", line 111, in <module>
    from ._type_aliases import (
  File "/home/cch-student/.local/lib/python2.7/site-packages/numpy/core/_type_aliases.py", line 63, in <module>
    _concrete_types = {v.type for k, v in _concrete_typeinfo.items()}
  File "/home/cch-student/.local/lib/python2.7/site-packages/numpy/core/_type_aliases.py", line 63, in <setcomp>
    _concrete_types = {v.type for k, v in _concrete_typeinfo.items()}
AttributeError: 'tuple' object has no attribute 'type'

please help me with this error.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-01-30 12:31:47 -0500

tfoote gravatar image

The backtrace indicates that you're having trouble importing numpy. You might have corrupted or changed the version of that installation. Are you expecting that to be in user local pip installation of numpy?

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-01-30 05:25:55 -0500

Seen: 724 times

Last updated: Jan 30 '19