Reputation: 1245
I've written a simulator in python and I use Pypy to speed it up. I need the Pulp module for integer programming, which is not supported by Pypy as far as I can say (http://pypy.org/compat.html).
Is there any clean way to use pulp from Pypy? A python wrapper of some sort, or even a way to call a python script externally and get the results?
-Many thanks
Upvotes: 2
Views: 524
Reputation: 1245
After reading delnan's comment, I realized that pypy could not find pulp because it did not know where to look for it. It was complaining:
from pulp import *
ImportError: No module named pulp
Adding the line
sys.path.append('/usr/local/lib/python2.7/dist-packages/PuLP-1.4.8-py2.7.egg/pulp') from pulp import *
did the trick and now it seems to work.
Interestingly, running pulp with pypy is twice slower than with normal python. I suspect its the startup cost for the JIT.
Upvotes: 2