Rosanswers logo

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/pioneer.py

But I'm getting an error:

Traceback (most recent call last):
  File "app_main.py", line 51, in run_toplevel
  File "scripts/pioneer.py", line 5, in 
    import roslib
  File "/opt/ros/groovy/lib/python2.7/dist-packages/roslib/__init__.py", line 50, in 
    from roslib.launcher import load_manifest
  File "/opt/ros/groovy/lib/python2.7/dist-packages/roslib/launcher.py", line 42, in 
    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

Originally posted by victorp on ROS Answers with karma: 50 on 2013-06-26

Post score: 1


1 Answer 1


Rosanswers logo

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

Originally posted by tfoote with karma: 58457 on 2013-08-12

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by gre721 on 2016-12-19:
Could you solve to use pypy with ROS?

Thank you!

Comment by ahendrix on 2016-12-19:
No; as @tfoote said this would require a significant rewrite of tf (and probably other libraries that use the cpython API).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.