Comments (18)
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.
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.
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.
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.
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.
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.
Can you try:
from rapidfuzz import fuzz_cpp
from levenshtein.
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.
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.
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.
Could you try:
RAPIDFUZZ_BUILD_EXTENSION="1" pip install . -v
to check why the c++ build fails?
from levenshtein.
this would be the full result: dump.txt
from levenshtein.
It appears you did not clone the submodules. You should be able to get them using:
git submodule update --init
from levenshtein.
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.
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.
if the file is present, what is the file name? (to check whether the platform tag is correct)
from levenshtein.
I think we should keep this open, for anyone else running into this issue until it is resolved in scikit-build
.
from levenshtein.
This should be fixed with the latest version of scikit-build
from levenshtein.
Related Issues (20)
- Mypy complaines with newest release (20.07), code still works HOT 3
- Extension to word-level HOT 1
- score_cutoff argument not seeming to work for ratio HOT 6
- Non-standard function signature for get_requires_for_build_wheel() HOT 2
- Mismatch between different implementations of Levenshtein HOT 5
- Support Java JNI call HOT 1
- Module 'Levenshtein' has no attribute 'distance' HOT 13
- Fails to build debian11/python 3.9: Could NOT find Python (missing: Interpreter Development.Module) HOT 15
- dependency rapidfuzz 3.0 HOT 1
- Compatibility with rapidfuzz-cpp 2.0.0 HOT 2
- Make it a rust crate HOT 6
- License HOT 1
- Levenshtein realisation counts substitution as 2 edits instead of 1 HOT 2
- Compatibility with rapidfuzz-cpp 3 HOT 2
- please provide a source tarball including external dependencies HOT 4
- `Callable` missing type argument, making some methods partially-Unknown HOT 6
- Citation HOT 1
- Damerau–Levenshtein distance HOT 1
- jaro_winkler gives values larger than 1. HOT 2
- Distance finds min cost not min number HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from levenshtein.