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
10
votes
1 answer

Why won't Python Multiprocessing Workers die?

I'm using the python multiprocessing functionality to map some function across some elements. Something along the lines of this: def computeStuff(arguments, globalData, concurrent=True): pool = multiprocessing.Pool(initializer=initWorker,…
Ant6n
  • 1,887
  • 1
  • 20
  • 26
10
votes
1 answer

Optimizing for PyPy

(This is a follow-up to Statistical profiler for PyPy) I'm running some Python code under PyPy and would like to optimize it. In Python, I would use statprof or lineprofiler to know which exact lines are causing the slowdown and try to work around…
Ecir Hana
  • 10,864
  • 13
  • 67
  • 117
10
votes
3 answers

Is there a way to avoid this memory error?

I'm currently working through the problems on Project Euler, and so far I've come up with this code for a problem. from itertools import combinations import time def findanums(n): l = [] for i in range(1, n + 1): s = [] for…
Jesse Neff
  • 103
  • 1
  • 1
  • 6
10
votes
2 answers

PyPy cpyext: any documentation? how to use? PyThreadState_Get error?

I have read (here) that PyPy has support for CPython extension modules via cpyext. I haven't found any cpyext documentation. Is there any? How do I use it? From the source code (e.g. here), I figured out that to load my leveldb.so module, I probably…
Albert
  • 65,406
  • 61
  • 242
  • 386
9
votes
1 answer

are generators supported in RPython?

Are generators supported in RPython, because I just read something in PyPy's documentation that says they are not PyPy Doc - Coding Guide They seem easy to be translated to a statically typed language like C because every generation step is…
costy.petrisor
  • 783
  • 7
  • 17
9
votes
1 answer

Why is PyPy translate so slow?

It takes hours to translate pypy implementation to c files and build the pypy-c on a modern notebook, with 2G mem and an Intel Core2 2GHz CPU. I know it's a cpu-intensive task, but does it have to be so slow? Is there any chance or room to reduce…
jaimechen
  • 511
  • 1
  • 5
  • 17
9
votes
0 answers

Is pypy compatible with tensorflow?

I am looking for a wheel compatible with pypy, without success. pypy3 -m pip install https://files.pythonhosted.org/packages/f4/28/96efba1a516cdacc2e2d6d081f699c001d414cc8ca3250e6d59ae657eb2b/tensorflow-1.14.0-cp37-cp37m-manylinux1_x86_64.whl…
Thomas Jalabert
  • 1,344
  • 9
  • 19
9
votes
1 answer

Where and in what context did Guido van Rossum say "If you want your code to run faster, you should probably just use PyPy."?

PyPy's main page states that Guido van Rossum has said: If you want your code to run faster, you should probably just use PyPy. PyPy's home page does not refer as to where or in what context this statement has been made. Did he say that in a…
Eray Erdin
  • 2,633
  • 1
  • 32
  • 66
9
votes
8 answers

Dockerfile fails with llvm-config error for numba install

My Dockerfile using a pypy base fails with FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config' when installing llvmlite, a dependency of numba which is listed in my requirements.txt I tried to follow and update the instructions…
Olddave
  • 397
  • 1
  • 2
  • 12
9
votes
2 answers

How to use PIL with PyPy?

I searched a little bit but I couldn't find a tuto to use PIL with PyPy. According to PyPy's blog, PIL is supported. I installed PIL with pip in my PYTHONPATH. After the download, pip make 2 .pyd files: _imaging.pyd and _imagingmath.pyd. After the…
Syl
  • 2,733
  • 2
  • 17
  • 20
9
votes
2 answers

No module named numpy with pypy

This question is related to Using Numpy with pypy I tried to use pip install git+https://bitbucket.org/pypy/numpy.git The system (Fedora release 24 (Twenty Four)) said git: 'submodule' is not a git command. See 'git --help'. Command "git…
Rodriguez
  • 239
  • 1
  • 3
  • 7
9
votes
2 answers

Are there any examples of multithreaded Tracing JIT compilers?

Both the JVM and the .NET CLR include Just-In-Time compilers which support multiple user threads. However, I believe these are method-at-a-time JITs. All of the tracing JITs I am aware of, for example LuaJIT and PyPy, are only single-threaded. Are…
user200783
  • 13,722
  • 12
  • 69
  • 135
9
votes
2 answers

Install matplotlib to pypy

When I'm trying to install matplotlib using pip it throw me exception: In file included from /usr/include/numpy/ndarrayobject.h:26:0, from src/file_compat.h:7, from…
Dima Kudosh
  • 7,126
  • 4
  • 36
  • 46
9
votes
2 answers

How to install numpy for PyPy on Windows?

I've just installed PyPy on Windows and seen an approximately 10x speed improvement in some simulation code I'm running. I'd like to see similar on code using numpy, too. I'm not an experienced Python programmer however and I'm finding the…
TooTone
  • 7,129
  • 5
  • 34
  • 60
8
votes
1 answer

RPython sys methods don't work

I have the following code: import sys def entry_point(argv): sys.exit(1) return 0 def target(*args): return entry_point, None However, when I run python ./pypy/pypy/translator/goal/translate.py t.py I get the following…
math4tots
  • 8,540
  • 14
  • 58
  • 95