Skip to content

Problem with package: rapidfuzz - undefined symbol: __atomic_compare_exchange_8 #313

@Jackenmen

Description

@Jackenmen

Package name

rapidfuzz

Package version

2.1.4 - 2.4.2

PyPI URL

https://pypi.org/project/rapidfuzz/

piwheels URL

https://www.piwheels.org/project/rapidfuzz/

Python version

  • Python 3.5
  • Python 3.7
  • Python 3.9

I am the maintainer

  • Yes

More information

On freshly flashed Raspberry Pi OS 10 (Legacy) and Raspberry Pi OS 11 armhf, this can be reproduced by running these commands:

sudo apt install python3-venv
python3 -m venv repro
. repro/bin/activate
python -m pip install -U rapidfuzz
python -c 'import rapidfuzz'

Which results in output:

pi@raspberrypi:~ $ python3 -m venv repro
pi@raspberrypi:~ $ . repro/bin/activate
(repro) pi@raspberrypi:~ $ python -m pip install -U rapidfuzz
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting rapidfuzz
  Downloading https://www.piwheels.org/simple/rapidfuzz/rapidfuzz-2.4.2-cp39-cp39-linux_armv7l.whl (2.0 MB)
     |████████████████████████████████| 2.0 MB 1.3 MB/s 
Collecting jarowinkler<2.0.0,>=1.2.0
  Downloading https://www.piwheels.org/simple/jarowinkler/jarowinkler-1.2.0-cp39-cp39-linux_armv7l.whl (92 kB)
     |████████████████████████████████| 92 kB 140 kB/s 
Installing collected packages: jarowinkler, rapidfuzz
Successfully installed jarowinkler-1.2.0 rapidfuzz-2.4.2
(repro) pi@raspberrypi:~ $ python -c 'import rapidfuzz'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/pi/repro/lib/python3.9/site-packages/rapidfuzz/__init__.py", line 8, in <module>
    from rapidfuzz import process, distance, fuzz, string_metric, utils
  File "/home/pi/repro/lib/python3.9/site-packages/rapidfuzz/process.py", line 10, in <module>
    cdist = _fallback_import("rapidfuzz.process_cdist", "cdist")
  File "/home/pi/repro/lib/python3.9/site-packages/rapidfuzz/utils.py", line 17, in _fallback_import
    mod = importlib.import_module(module + "_cpp")
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/pi/repro/lib/python3.9/site-packages/rapidfuzz/process_cdist_cpp.py", line 3, in <module>
    from rapidfuzz.process_cdist_cpp_impl import (
ImportError: /home/pi/repro/lib/python3.9/site-packages/rapidfuzz/process_cdist_cpp_impl.cpython-39-arm-linux-gnueabihf.so: undefined symbol: __atomic_compare_exchange_8
(repro) pi@raspberrypi:~ $

When not using the built wheels, this error does not occur:

pi@raspberrypi:~ $ python3 -m venv manual_build
@raspberrypi:~ $ . manual_build/bin/activate
(manual_build) pi@raspberrypi:~ $ python -m pip install -U rapidfuzz --no-binary :all:
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting rapidfuzz
  Downloading rapidfuzz-2.4.2.tar.gz (1.1 MB)
     |████████████████████████████████| 1.1 MB 1.4 MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting jarowinkler<2.0.0,>=1.2.0
  Downloading jarowinkler-1.2.0.tar.gz (84 kB)
     |████████████████████████████████| 84 kB 385 kB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: rapidfuzz, jarowinkler
  Building wheel for rapidfuzz (PEP 517) ... done
  Created wheel for rapidfuzz: filename=rapidfuzz-2.4.2-py3-none-any.whl size=42562 sha256=984737dad7f822a72a3b602bfcbad2a51b4eddd611e595da60100c949aa54ef8
  Stored in directory: /home/pi/.cache/pip/wheels/af/99/46/b4f077eb37c0b9b373ef6a18e861eb7fad8def017b50f95f8d
  Building wheel for jarowinkler (PEP 517) ... done
  Created wheel for jarowinkler: filename=jarowinkler-1.2.0-py3-none-any.whl size=6729 sha256=70ed085038c7bde06812694e2d40c6545c7f5710ac14de6457dfcc2358a2a4c2
  Stored in directory: /home/pi/.cache/pip/wheels/e8/9a/b5/479eb2f7259ba5d0c17fe12140829c71ccef2b16c3ba77a537
Successfully built rapidfuzz jarowinkler
Installing collected packages: jarowinkler, rapidfuzz
Successfully installed jarowinkler-1.2.0 rapidfuzz-2.4.2
(manual_build) pi@raspberrypi:~ $ python -c 'import rapidfuzz'
(manual_build) pi@raspberrypi:~ $

I have also tried using --no-binary rapidfuzz instead of --no-binary :all: and in that case, there are also no errors.

At first, I thought that this is probably an issue with the package but since I tried installing it without using pre-built wheels and it worked fine, I figured that maybe it has something to do with how piwheels built the package.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions