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
0
votes
0 answers

Error reported in my solution to find the diameter of a tree

I tried solving a challenge that asks for the diameter of a tree (not necessarily a binary tree) in python 3.0. The challenge is actually to find the "circumference" of a tree, which is basically the diameter of a tree (length of the longest path)…
0
votes
2 answers

Is python GC guaranteed to be a ref counting garbage collector

For my repository class, I am creating an connection to the database when a function needs it (if None). I am using the __del__ to close the connection if not None. The object is guaranteed to be short lived. I realized I am dependent on Ref…
Hemil
  • 916
  • 9
  • 27
0
votes
1 answer

Run different script with pypy3 or python

Is there a way to run the main script in pypy3, but an import, say helper.py to be executed/interpreted by regular python? And vice versa? To clarify, let's say I have main.py that I want to execute with pypy3. That script imports helper and I…
user1179317
  • 2,693
  • 3
  • 34
  • 62
0
votes
1 answer

How do I download PyPy?

I run Windows 10 64 bit. I haven't tried downloading PyPy because I didn't find any tutorials on YouTube. I have also went to the official PyPy website but it is for Python 3.6 Do I need to have python 3.6 downloaded too? Also tell the steps to…
user14054515
0
votes
1 answer

What are the packages pypy include by default

Does pypy include the entire CPython standard library?
theX
  • 1,008
  • 7
  • 22
0
votes
1 answer

How do I use savReaderWriter with pypy3, or is there a better alternative?

So I managed to install savReaderWriter for pypy3, but when I try to read a file with SavReader, I get the following error: OSError: Cannot load library…
Peter Ruse
  • 13
  • 3
0
votes
0 answers

argparse: ArgumentParser().add_subparsers: TypeError: __init__() got an unexpected keyword argument 'required'

I'm trying to figure out why this test case doesn't work on latest PyPy, but works on Python 3: __import__("argparse").ArgumentParser().add_subparsers(required=True, dest="action") Is there a backported version of argparse I could pull in to bypass…
d33tah
  • 10,999
  • 13
  • 68
  • 158
0
votes
0 answers

Two similar codes differ in speed in PyPy3

Here is a simplified code of nested loop and some if-conditions regarding index-access to a list. I noticed that the second code (# In separate loops) works twice faster than the first one (# In the same loops) in PyPy3 (ver. 7.3.1). Both run in the…
solzard
  • 93
  • 1
  • 5
0
votes
0 answers

How do I speed up file I/O in PyPy3?

In CPython, I'm able to read a 1.6 GB file in 11 seconds, using lines = f.read().splitlines(), while in PyPy3, the exact same code takes 2 minutes to read the file. Using f.read().split('\n') manages to do it in 1 minute, but is still much slower…
Peter Ruse
  • 13
  • 3
0
votes
1 answer

Python : Can't install Pillow library on Pypy3.7 (7.3.1)

Pillow doesn't seem to install on Pypy3.7. I am running this on Mac OS, Catalina 10.15.4. Pip3 install Pillow returns: During handling of the above exception, another exception occurred: Traceback (most recent call last): File…
yongju lee
  • 564
  • 1
  • 4
  • 16
0
votes
2 answers

Why calculating small fibonacci sequence with Python interpreter faster than PyPy

I was making some fibonacci calculations with PyPy, first i started with bigger numbers, PyPy was a little bit faster, but with small numbers it gives nearly the same performance and some cases normal interpreter is much more faster than pypy is…
Yagiz Degirmenci
  • 16,595
  • 7
  • 65
  • 85
0
votes
1 answer

ImportError when importing cx_Oracle with PyPy

I was previously using python to pass multiple queries to an Oracle Database but the script took too long to execute. So I decided to opt for PyPy and use the JIT Compiler rather than the CPython interpreter. I installed PyPy via apt and then…
0
votes
0 answers

How to use a c extension in PYPY which made by CFFI

I am trying to access a function that originally form XXX.c and XXX.h, compiled to XXX.so' and then XXX_.c is made via CFFI. When the test file which simply imports XXX_ and calls a function of XXX_'s, it works fine. But when I use pypy test.py…
heisthere
  • 374
  • 1
  • 12
0
votes
1 answer

pypy3 dyld can not be found in homebrew

I got the following error when I use homebrew. Does anybody know how to fix the problem? dyld: Library not loaded: /usr/local/opt/libffi/lib/libffi.6.dylib Referenced from: /usr/local/Cellar/pypy/7.1.1_1/libexec/lib/libpypy-c.dylib Reason: image…
user1424739
  • 11,937
  • 17
  • 63
  • 152
0
votes
1 answer

How to use pypy

I have just installed pypy (pypy3.5-v7.0.0-win32.zip from https://bitbucket.org/pypy/pypy/downloads/) to run my code faster and now I don't know how to use it for my python 3.5.0 program. I sow this Using PyPy to run a Python program?, but I didn't…
Gheorghe Gh
  • 41
  • 1
  • 10