Git Product home page Git Product logo

Comments (18)

Kolumbs avatar Kolumbs commented on June 8, 2024 1

I have reinstalled again and it is ok:

Python 3.10.7 (main, Sep 25 2022, 13:32:17) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from rapidfuzz import fuzz_cpp
>>> 

sorry for fake claims, apparently at the first reinstallation maybe I took some previous wheel or maybe even accidentally installed rapidfuzz-2.10.3-py3-none-any.whl instead of rapidfuzz-2.10.3-cp310-cp310-linux_armv7l.whl . Not sure. Anyhow all good now. Thanks.
Not sure if I should close this or you want to close it as soon as the scikit-build regression is fixed, which was the original cause of this bug for Levenshtein.

from levenshtein.

maxbachmann avatar maxbachmann commented on June 8, 2024

Ah yes that is a bug in scikit-build: scikit-build/scikit-build#718, so you can workaround this by hardcoding the version in the pyproject.toml: "scikit-build==0.14.1". I am experiencing this when developing on Fedora as well.

I still need to test whether the build passes with 0.14.1 everywhere. If it does I I will hardcode it until there is a fix in scikit-build.

from levenshtein.

maxbachmann avatar maxbachmann commented on June 8, 2024

Uh this requires more work, since the piwheels build fails.
Seems like either their compiler does not support C++17 or there is a compiler bug I need to workaround ...

from levenshtein.

Kolumbs avatar Kolumbs commented on June 8, 2024

well, I don't observe anymore fails after forcing scikit-build to use 0.14.1 version:

$ pip3 install .
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Processing /home/juris/Levenshtein
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: rapidfuzz<3.0.0,>=2.3.0 in /home/juris/.local/lib/python3.10/site-packages (from Levenshtein==0.20.5) (2.10.2)
Requirement already satisfied: jarowinkler<2.0.0,>=1.2.2 in /home/juris/.local/lib/python3.10/site-packages (from rapidfuzz<3.0.0,>=2.3.0->Levenshtein==0.20.5) (1.2.3)
Building wheels for collected packages: Levenshtein
  Building wheel for Levenshtein (pyproject.toml) ... done
  Created wheel for Levenshtein: filename=Levenshtein-0.20.5-cp310-cp310-linux_armv7l.whl size=165564 sha256=5b6eb87aed1223ee3b78db4ffff1f6c334b37a888b426aadf822da60b3b0b129
  Stored in directory: /tmp/pip-ephem-wheel-cache-m9xx6z2k/wheels/b3/27/31/93160a7a7432fa29e69bfdcd8d0b87fe1c99a6a6b5950d1ab5
Successfully built Levenshtein
Installing collected packages: Levenshtein
  Attempting uninstall: Levenshtein
    Found existing installation: Levenshtein 0.20.5
    Uninstalling Levenshtein-0.20.5:
      Successfully uninstalled Levenshtein-0.20.5
Successfully installed Levenshtein-0.20.5

from levenshtein.

maxbachmann avatar maxbachmann commented on June 8, 2024

You should probably build rapidfuzz from source as well, since the build on piwheels is broken right now due to this bug in scikit-build + a bug in gcc ...
Otherwise you only have the pure Python version, which is quite a bit slower.

from levenshtein.

Kolumbs avatar Kolumbs commented on June 8, 2024

I think I got from pip some prebuilt rapidfuzz, so I have everything allright now:

Python 3.10.7 (main, Sep 25 2022, 13:32:17) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from rapidfuzz import process, fuzz
>>> choices = ["Atlanta Falcons", "New York Jets", "New York Giants", "Dallas Cowboys"]
>>> process.extract("new york jets", choices, scorer=fuzz.WRatio, limit=2)
[('New York Jets', 100.0, 1), ('New York Giants', 78.57142857142857, 2)]

from levenshtein.

maxbachmann avatar maxbachmann commented on June 8, 2024

Can you try:

from rapidfuzz import fuzz_cpp

from levenshtein.

Kolumbs avatar Kolumbs commented on June 8, 2024

ah well this then means I am using the slow version:

Python 3.10.7 (main, Sep 25 2022, 13:32:17) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from rapidfuzz import fuzz_cpp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'fuzz_cpp' from 'rapidfuzz' 

from levenshtein.

maxbachmann avatar maxbachmann commented on June 8, 2024

Yes I expected this, since the arm build on https://www.piwheels.org/project/rapidfuzz/ was silently broken. I hope this will be fixed by the changes in rapidfuzz/RapidFuzz@24bf798

from levenshtein.

Kolumbs avatar Kolumbs commented on June 8, 2024

i took your latest commit from rapidfuzz and I am afraid the problem is still there. This is what I got after build in rapidfuzz repo:

WARNING: The C extension could not be compiled, speedups are not enabled.
Plain-Python build succeeded.

from levenshtein.

maxbachmann avatar maxbachmann commented on June 8, 2024

Could you try:

RAPIDFUZZ_BUILD_EXTENSION="1" pip install . -v

to check why the c++ build fails?

from levenshtein.

Kolumbs avatar Kolumbs commented on June 8, 2024

this would be the full result: dump.txt

from levenshtein.

maxbachmann avatar maxbachmann commented on June 8, 2024

It appears you did not clone the submodules. You should be able to get them using:

git submodule update --init

from levenshtein.

Kolumbs avatar Kolumbs commented on June 8, 2024

yes sorry those submodules were culprit, it built the thing, not sure though why this would still complain:

>>> from rapidfuzz import fuzz_cpp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'fuzz_cpp' from 'rapidfuzz'

from levenshtein.

maxbachmann avatar maxbachmann commented on June 8, 2024

Hm can you check whether the fuzz_cpp.*.so file is present in the corresponding site-packages directory (site-packages/rapidfuzz/fuzz)?
If it is you can try to cd into the directory and try to import fuzz_cpp in there.

from levenshtein.

maxbachmann avatar maxbachmann commented on June 8, 2024

if the file is present, what is the file name? (to check whether the platform tag is correct)

from levenshtein.

maxbachmann avatar maxbachmann commented on June 8, 2024

I think we should keep this open, for anyone else running into this issue until it is resolved in scikit-build.

from levenshtein.

maxbachmann avatar maxbachmann commented on June 8, 2024

This should be fixed with the latest version of scikit-build

from levenshtein.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.