Ask Your Question

Using pypy with ROS for better performance ?

asked 2013-06-26 22:08:11 -0500

victorp gravatar image

updated 2014-01-28 17:17:03 -0500

ngrennan gravatar image

How can I use pypy instead of the default python interpreter for a ROS node written in python ? I tried:

cd /path/to/node
pypy script/

But I'm getting an error:

Traceback (most recent call last):
  File "", line 51, in run_toplevel
  File "scripts/", line 5, in <module>
    import roslib
  File "/opt/ros/groovy/lib/python2.7/dist-packages/roslib/", line 50, in <module>
    from roslib.launcher import load_manifest
  File "/opt/ros/groovy/lib/python2.7/dist-packages/roslib/", line 42, in <module>
    import rospkg
ImportError: No module named rospkg

Also, changing the first line of the script to #!/usr/bin/pypy and using rosrun yields the same.

EDIT: OK, I added the missing directories to sys.path (namely /usr/lib/pymodules/python2.7) but now I'm getting another error:

ImportError: No module named _tf
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-08-12 10:55:01 -0500

tfoote gravatar image

tf uses c binding for python which are going to be harder in pypy.

edit flag offensive delete link more


Could you solve to use pypy with ROS?

Thank you!

gre721 gravatar image gre721  ( 2016-12-19 10:25:11 -0500 )edit

No; as @tfoote said this would require a significant rewrite of tf (and probably other libraries that use the cpython API).

ahendrix gravatar image ahendrix  ( 2016-12-19 12:14:29 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-06-26 22:08:11 -0500

Seen: 1,024 times

Last updated: Dec 19 '16