![](https://secure.gravatar.com/avatar/6f4d592eab04f593a4b62ff87015dbea.jpg?s=120&d=mm&r=g)
Lastly what is the right way to get the platform as pypy not cpython? -- Robin Becker
Maciej already answered the other stuff. I had pypy working with reportlab a long time ago just by not using the C extensions at all. Detecting pypy is a bit harder. https://www.python.org/dev/peps/pep-0421/#version-format was supposed to fix things lac@smartwheels:~$ python3.5 Python 3.5.0rc1 (default, Aug 12 2015, 14:57:46) [GCC 5.2.1 20150808] on linux Type "help", "copyright", "credits" or "license" for more information.
import sys sys.implementation namespace(_multiarch='x86_64-linux-gnu', cache_tag='cpython-35', hexversion=50659521, name='cpython', version=sys.version_info(major=3, minor=5, micro=0, releaselevel='candidate', serial=1))
Okay, you could fish around in that and get what you are looking for. But Python 2.7.10 (default, Jul 1 2015, 10:54:53) [GCC 4.9.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import sys sys.implementation Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'implementation'
This won't. So I just try to import __pypy__ If it succeeds, I have pypy, and if it doesn't I assume CPython. Laura