Question

I'm trying to use pypy compiler to run my python code but the sys.path for pypy is different from normal python compiler so when I tried to import default modules such as

import pygame

it fails in pypy, stating that the module is not found, while it works correctly with the normal python command. Any help is greatly appreciated.

Was it helpful?

Solution

I think you're expecting any module installed for CPython to work with PyPy out of the box. That's not the case. It's the same when you upgrade from CPython 2.6 to CPython 2.7: the modules you have already installed for 2.6 are not automatically available for 2.7, and must be re-installed. Similarly, you must re-install the modules for PyPy.

This said, the standard pygame doesn't work too well with PyPy, but stay tuned; it seems someone is working on a version of pygame based on cffi, which should work very well with PyPy.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top