Questions tagged [pypy]

PyPy is an implementation of the Python language. Do not confuse with PyPI, the package index. General Python questions should just be tagged with python.

PyPy is a fast, very compliant, self-hosting implementation of the Python language. PyPy started out being a Python interpreter written in the Python language itself. It is built using the language.

PyPy has several advantages and distinctive features, including:

  • Speed: thanks to its Just-in-Time (JIT) compiler, Python programs often run faster on PyPy.

  • Sandboxing: PyPy provides the ability to run untrusted code in a fully secure way.

  • Stackless: PyPy can be configured to run in stackless mode, providing micro-threads for massive concurrency.

Programmers interested in following PyPy's progress should check the Dev Site and the PyPy Status Blog. For background, see PyPy - Goals and Architecture Overview.

Releases and builds

At this time there are three PyPy release series with binaries for x86, ARM, and PPC, on Linux, Mac OS/X and Windows:

  • PyPy2.7 v5.6.0 (the Python2.7 compatible release)
  • PyPy3.3 v5.5.0 (the Python3.3 compatible release)
  • PyPy-STM v2.5.1 (Linux x86-64 only)

More informations about builds and versions on download page. There are also nightly builds available.

794 questions
6
votes
4 answers

Production ready Python implementations besides CPython?

Except for CPython, which other Python implementations are currently usable for production systems? The questions What are the pros and cons of the various Python implementations? I have been trying to wrap my head around the PyPy project. So,…
wr.
  • 2,841
  • 1
  • 23
  • 27
6
votes
1 answer

Why is 0/1 faster than False/True for this sieve in PyPy?

Similar to why use True is slower than use 1 in Python3 but I'm using pypy3 and not using the sum function. def sieve_num(n): nums = [0] * n for i in range(2, n): if i * i >= n: break if nums[i] == 0: for j in…
qwr
  • 9,525
  • 5
  • 58
  • 102
6
votes
1 answer

Running twistd with Pypy

I'm trying Pypy because it shows impressive benchmarks over CPython. Also, I'm mostly using the Twisted library in my code. I can now run a benchmark script which uses the Twisted reactor so I guess my setup is good. However, I do not know how to…
esamson
  • 140
  • 3
  • 8
6
votes
1 answer

Python: getting segmentation fault when using compile/eval

Code: import ast globalsDict = {} fAst = ast.FunctionDef( name="foo", args=ast.arguments(args=[], vararg=None, kwarg=None, defaults=[]), body=[], decorator_list=[]) exprAst =…
Albert
  • 65,406
  • 61
  • 242
  • 386
6
votes
1 answer

Using the socket module in sandboxed Pypy

I'm attempting to allow a subprocess sandboxed with Pypy to communicate, using a limited protocol, with the parent process. After reviewing the source code of the pypy/pypy/translator/sandbox/sandlib.py included with Pypy, it appears that there is a…
nickname
  • 1,187
  • 1
  • 9
  • 20
6
votes
1 answer

PyPy Error: AttributeError: No symbol SCDynamicStoreCopyProxies found in library

I have a program on my Mac, and I think it is too slow. I want to use pypy to speed it up. I got pypy's binary distribution for mac, and I ran ./pypy -m pip install .... It said that I need to run ensurepip. But when I ran it, it raised this error: …
Andy Zhang
  • 198
  • 4
  • 21
6
votes
2 answers

NumPy: Alternative to `vectorize` that lets me access the array

I have this code: output_array = np.vectorize(f, otypes='d')(input_array) And I'd like to replace it with this code, which is supposed to give the same output: output_array = np.ndarray(input_array.shape, dtype='d') for i, item in…
Ram Rachum
  • 84,019
  • 84
  • 236
  • 374
6
votes
1 answer

Install pypy3 on raspberry pi

I have a python3 script which I need to run faster, so I'm trying to install pypy3 on my raspberry pi which is running raspbian stretch 4.14. It looks like pypy came pre-installed, but it's version 2.7.12 and it's not working with my python3…
AbdurRehman Khan
  • 830
  • 9
  • 20
6
votes
2 answers

Fast GUIDs in Python

I have developed a performance critical and CPU intensive application in Python. To reach acceptable performance I'm using PyPy and multiple processes generated with os.fork. Overall I'm now satisfied with performance which is near that of compiled…
Gellweiler
  • 751
  • 1
  • 12
  • 25
6
votes
2 answers

How to initialize a set() in code to be compiled as pypy's rpython?

I want to compile some python code using pypy's rpython translator. A very simple toy example that doesn't do anything : def main(argv): a = [] b = set(a) print b return 0 def target(driver,args): return main,None If I compile it…
highBandWidth
  • 16,751
  • 20
  • 84
  • 131
6
votes
0 answers

How do I profile memory usage with pypy?

I've tried the following profilers, all of which are not compatible with pypy (5.8.0): pympler: fails on import as pypy does not support __itemsize__, and according to some google results it would not produce useful results anyways vmprof: outputs…
l4mpi
  • 5,103
  • 3
  • 34
  • 54
6
votes
2 answers

How to use PyPy (for python 3.6) on PyCharm running on Windows 10?

Hi I'm trying to use PyPy (for Python 3) as an interpreter on my PyCharm community version running on Windows 10. I don't see any install options specifically for Windows on the PyPy website. Is there a way to use the source code or the binaries to…
keon6
  • 97
  • 1
  • 1
  • 6
6
votes
2 answers

PyPy: ImportError: No module named requests

Whenever I run pypy test.py in the Mac OS X 10 Terminal, I get a File "test.py", line 8, in import requests ImportError: No module named requests However, this works well and without any errors when I do python test.py and when I open…
DaveTheAl
  • 1,995
  • 4
  • 35
  • 65
6
votes
1 answer

How do I install PyPy on appveyor?

I have a Python extension that needs to be compiled against the PyPy interpreter on the Windows-based Appveyor continuous integration service. How do I get PyPy in that environment?
joeforker
  • 40,459
  • 37
  • 151
  • 246
6
votes
0 answers

Is there some tool to convert a cython codebase back to pure python?

I'd like to do some real life benchmark comparing cpython+cython performances vs a pure pypy implementation. I have a quite big cython codebase (proprietary), with a good test coverage and some benchmarks, what I'd like to do is to test cython…
naufraghi
  • 1,514
  • 13
  • 16