PyRoaringBitMap: Does not install from PyPi on Linux Ubuntu aarch64

I am running on Linux Ubuntu for aarch64

After installing (venv), neither are recognized in my source

import pyroaring
# Or
from pyroaring import BitMap

I tried installing with both:

pip install pyroaring

# And

pip install --use-pep517 --no-cache-dir pyroaring

But when I do pip show -f pyroaring in see this:

$ pip show -f pyroaring
Name: pyroaring
Version: 0.4.0
Summary: Fast and lightweight set for unsigned 32 bits integers.
Home-page: https://github.com/Ezibenroc/PyRoaringBitMap
Author: Tom Cornebize
Author-email: tom.cornebize@gmail.com
License: MIT
Location: /home/fastfrank/frankc01/pysui/pysuienv/lib/python3.10/site-packages
Requires: 
Required-by: 
Files:
  pyroaring-0.4.0.dist-info/INSTALLER
  pyroaring-0.4.0.dist-info/LICENSE
  pyroaring-0.4.0.dist-info/METADATA
  pyroaring-0.4.0.dist-info/RECORD
  pyroaring-0.4.0.dist-info/REQUESTED
  pyroaring-0.4.0.dist-info/WHEEL
  pyroaring-0.4.0.dist-info/top_level.txt
  pyroaring.cpython-310-aarch64-linux-gnu.so

As I am intending to have this as a requirement for my SUI SDK pysui I need to ensure that Linux and macos users can install.

Any ideas?

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 23 (13 by maintainers)

Most upvoted comments

As a follow up, the VSCode issue, pyroaring is now part of pysui for the primary usage of generating a Roaring Bitmap as part of multi-sig signing.

The hidden gem is also the fact that pyroaring serializes as per https://github.com/RoaringBitmap/RoaringFormatSpec/

Thank you for your efforts!

from pyroaring import BitMap; print(pyroaring.__version__)

This is expected to give an error. If you do pyroaring import BitMap, you are importing BitMap but not pyroaring, so pyroaring.__version__ should fail because pyroaring is undefined, and indeed it does.

Your last example suggests that everything works as expected.

Quick question, I’m not that strong on pip but how do I ‘use a pre-compiled wheel’ from PyPi?

You look at the output from pip install, what kind of file it downloads. If it is a *.tar.gz, then it is the source package (which requires a C compiler), if it is a *.whl then it is a wheel (which is already compiled).

For instance, using pip install pyroaring in a virtualenv on my Mac M1:

  • With Python 3.7 (for which there is no available wheel):
pip install pyroaring
Collecting pyroaring
  Downloading pyroaring-0.4.1.tar.gz (145 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 145.5/145.5 KB 8.2 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for pyroaring, since package 'wheel' is not installed.
Installing collected packages: pyroaring
  Running setup.py install for pyroaring ... done
Successfully installed pyroaring-0.4.1
  • With Python 3.10 (using a wheel):
pip install pyroaring
Collecting pyroaring
  Downloading pyroaring-0.4.1-cp310-cp310-macosx_11_0_arm64.whl (242 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 242.4/242.4 kB 10.4 MB/s eta 0:00:00
Installing collected packages: pyroaring
Successfully installed pyroaring-0.4.1

If you want to be sure about which file is used for the installation, you can also copy the file URL from this page and directly give the URL to pip. Be careful to select the right file (OS, Python version and architecture), or pip will not install anything. For instance, on a Mac M1 with Python 3.10:

pip install https://files.pythonhosted.org/packages/af/a9/4b6e2177bdd544be0ad2b870065ecf42119faf554b20e09365daf01a7285/pyroaring-0.4.1-cp310-cp310-macosx_11_0_arm64.whl