trac_ik_python - "ImportError: No module named trac_ik_wrap" when installing via apt-get install ros-kinetic-trac-ik

Issue #50 closed
Joseph Coombe created an issue

@awesomebytes

I am able to use trac_ik_python w/o any problems if I clone it into my catkin_ws.

However, if I install it via $ sudo apt-get install ros-kinetic-trac-ik, I get the following ImportError when trying to use it.

Traceback (most recent call last):
  File "/home/joseph/.../catkin_ws/src/hebi_3dof_arm_description/src/trac_ik_end_traj_test.py", line 28, in <module>
    from trac_ik_python.trac_ik import IK
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/trac_ik_python/trac_ik.py", line 6, in <module>
    from trac_ik_python.trac_ik_wrap import TRAC_IK
ImportError: No module named trac_ik_wrap

Note: Thank for writing this wrapper. It has been very useful so far.

Comments (22)

  1. Sam Pfeiffer

    Weird! I'm giving it a look. @coombej Thank you for reporting. @pbeeson install rules problem maybe? I'm booting a VM with ubuntu 16.04 to check it out.

  2. Sam Pfeiffer

    Apparently on a devel environment the files trac_ik_wrap.py and _trac_ik_wrap.so (generated by SWIG) are placed in devel/lib/python2.7/dist-packages/trac_ik_python

    When doing install that same folder has them missing, and moreover, install/lib contains _trac_ik_wrap.so (but the .py file is completely missing).

  3. Patrick Beeson Account Deactivated

    I pushed the changes to the ROS buildfarm. Once this makes it to the kinetic/lunar public distros, please advise if this is fixed.

  4. pshelly

    Hello! I am using Ubuntu 16.04 with ROS kinetic. And the issue of the import error doesn't seem to be fixed.

  5. Patrick Beeson Account Deactivated

    Thanks for reporting. Can you please report the package version that you have installed?

  6. Joseph Coombe reporter

    @pshelly if you're installing via ~sudo apt-get ros-kinetic-trac-ik-python then the import error won't be fixed until the next public release of kinetic (perhaps at the end of this month).

  7. pshelly

    Thanks for the reply! I am using version 1.4.9 and yes I have installed it visa ~sudo apt-get ros-kinetic-trac-ik-python.

  8. pshelly

    I get following errors while compiling.

    trac_ik_python: error: build include path 'include' does not exist
    trac_ik_python: CMakeLists.txt(54): error: variable CMAKE_C_COMPILER is modified
    
  9. Sam Pfeiffer

    @pshelly are you running warnings as errors on CMake? Something like -Wall or -Werror somewhere in the configuration of your compiling system?

    Both 'errors' are true, but they should just be warnings. (There is no include folder, so there is nothing to include, and the CMAKE_C_COMPILER is indeed modified, cause it's the only way I found to make it compile).

  10. Joseph Coombe reporter

    Also there was a new ROS release yesterday , so @pshelly you might try using the binary sudo apt-get install ros-kinetic-trac-ik version again (make sure you remove the source version from your catkin_ws).

    I haven't tested the new binary release yet, but once have confirmed that it fixes my problem, I will close this issue.

  11. Joseph Coombe reporter

    Tested latest binary release of trac-ik-python sudo apt-get install ros-kinetic-trac-ik.

    It works! Made sure to delete source package from my catkin_ws as well as share and build folders in catkin_ws before rebuilding and testing.

    Thanks for fix!

  12. Ravi Joshi

    I am getting the same issue from trac_ik_python.trac_ik import IK. I installed trac_ik using sudo apt-get install ros-indigo-trac-ik. I also tried to update it using sudo apt-get install --reinstall ros-indigo-trac-ik but it didn't work. Please see below-

    ravi@home:~$ python
    Python 2.7.6 (default, Nov 23 2017, 15:49:48) 
    [GCC 4.8.4] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from trac_ik_python.trac_ik import IK
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/opt/ros/indigo/lib/python2.7/dist-packages/trac_ik_python/trac_ik.py", line 6, in <module>
        from trac_ik_python.trac_ik_wrap import TRAC_IK
    ImportError: No module named trac_ik_wrap
    >>> 
    

    I tried to see inside the directory and found few setup files as shown below-

    ravi@home:~$ ll /opt/ros/indigo/lib/python2.7/dist-packages/trac_ik_python/total 36
    drwxr-xr-x   2 root root  4096 Jun  7 00:58 ./
    drwxr-xr-x 140 root root 12288 Jun  6 21:38 ../
    -rw-r--r--   1 root root     0 Jan 12 08:21 __init__.py
    -rw-r--r--   1 root root   157 Mar 18 00:23 __init__.pyc
    -rw-r--r--   1 root root  4489 Jan 12 08:21 trac_ik.py
    -rw-r--r--   1 root root  4442 Mar 18 00:23 trac_ik.pyc
    

    I am able to find out _trac_ik_wrap.so. See below-

    ravi@home:~$ locate _trac_ik_wrap.so
    /opt/ros/indigo/lib/_trac_ik_wrap.so
    

    Please note that I am operating Baxter robot in ROS Indigo on Ubuntu 14.04 LTS 64 Bit PC.

    One workaround might be installing trac_ik from the source. I haven't tired it yet. Any comments, please?

  13. Joseph Coombe reporter

    I don't think I can trigger a re-release since I'm not a repo owner. I'm pretty sure @pbeeson would have to do that.

  14. Log in to comment