pypy

Correct way to use venv and pip in pypy

Correct way to use venv and pip in pypy Question: I’ve been using cpython forever, but I’m new to pypy. In cpython, this is how I use virtual environments and pip. python3 -m venv venv source venv/bin/activate python3 -m pip install <package> I recently started using pypy for a project, and noticed that the following …

Total answers: 1

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

Why is 0/1 faster than False/True for this sieve in PyPy? Question: 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] …

Total answers: 1

PYPY venv pip ERROR: ModuleNotFoundError: No module named 'pip._vendor.six'

PYPY venv pip ERROR: ModuleNotFoundError: No module named 'pip._vendor.six' Question: I created venv according to pypy install site: System-Product-Name:~# virtualenv -p "/home/x/pypy3.8-v7.3.7-linux64/bin/pypy" ve created virtual environment PyPy3.8.12.final.0-64 in 102ms Success. Following step 2 (activation) worked as well… and using: $python opens pypy same as using ./pypy, which is as intended. However after this point nothing …

Total answers: 4

Occur "Could NOT find Arrow" error when using pip_pypy3 to install pyarrow

Occur "Could NOT find Arrow" error when using pip_pypy3 to install pyarrow Question: I am trying to use pypy3 to install pyarrow, but some errors occur. Basic information is blow: macOS 10.15.7 Xcode 12.3 python version 3.7.9 pypy3 version 7.3.3 pyarrow version 0.17.1 cmd is ‘pip_pypy3 install pyarrow==0.17.1’ Some key information and error content in …

Total answers: 3

Can't install numpy – MS Visual C++ 14.1 is required. But it is installed

Can't install numpy – MS Visual C++ 14.1 is required. But it is installed Question: I am on Windows 10 using pypy3.6-v7.3.0. I am trying to install numpy with pip install numpy, but I keep getting the error: error: Microsoft Visual C++ 14.1 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/. However …

Total answers: 4

Creating custom colormap for opencv python

Creating custom colormap for opencv python Question: I created a custom colormap in a text file, read from the python 3.6. To map each color in for loop it takes approx. 9 seconds. Here is the snippet: for x in range(256): # z = int(rgb_c[x][0]) # r = int(rgb_c[x][1]) # g = int(rgb_c[x][2]) # b …

Total answers: 1

Boolean identity == True vs is True

Boolean identity == True vs is True Question: It is standard convention to use if foo is None rather than if foo == None to test if a value is specifically None. If you want to determine whether a value is exactly True (not just a true-like value), is there any reason to use if …

Total answers: 7

Why shouldn't I use PyPy over CPython if PyPy is 6.3 times faster?

Why shouldn't I use PyPy over CPython if PyPy is 6.3 times faster? Question: I’ve been hearing a lot about the PyPy project. They claim it is 6.3 times faster than the CPython interpreter on their site. Whenever we talk about dynamic languages like Python, speed is one of the top issues. To solve this, …

Total answers: 12

How to run ipython with pypy?

How to run ipython with pypy? Question: How do I use ipython on top of a pypy interpreter rather than a cpython interpreter? ipython website just says it works, but is scant on the details of how to do it. Asked By: wim || Source Answers: You can create a PyPy virtualenv : virtualenv -p …

Total answers: 4

Drawbacks to running Django under PyPy?

Drawbacks to running Django under PyPy? Question: I understand that Django, PyPy, and Psycopg2 all work correctly together, and speed.pypy.org claims great performance improvements over CPython. Are there any downsides? Asked By: jl6 || Source Answers: The PyPy wiki lists Django as compatible, but it doesn’t go into great detail about how much of Django …

Total answers: 2