Open woctezuma opened 3 years ago
Related: #42, #44, #45, #46, https://github.com/seatgeek/fuzzywuzzy/issues/235
I haven't had a chance to test it on Windows or OSX yet, but I created wheels and put the package on pypi as levenshtein
. Could you let me know if this works for you?
pip install levenshtein
I cannot test it for now. If I remember right, the problem was solved by following the recommendation in the error message:
Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
Installing the Microsoft C++ Build Tools is always what works for me. It may be helpful to include this on the ReadMe instructions
On a Linux system you'll need Python dev tools, sudo dnf install python3-devel
.
On Ubuntu sudo apt-get install python3.9-dev
fixed this for me.
On Ubuntu
sudo apt-get install python3.9-dev
fixed this for me.
This actually works with every version e.g. sudo apt install python3.X-dev --> sudo apt install python3.8-dev
Sure I've misunderstood something but
pip install levenshtein
sudo apt install python3.X-dev
pip install python-Levenshtein
Is leaving me with the same legacy-install-error
.
@SolebaySharp why do you try to install both Levenshtein
and python-Levenshtein
? It would be enough to install Levenshtein
, which probably provides a wheel for your platform.
@maxbachmann Just to show I'd tried both approaches really.
@SolebaySharp did both approaches fail?
@maxbachmann yes unfortunately.
pip install python-Levenshtein
fails to install (legacy-install-error
) and pip install levenshtein
works but when I run from fuzzywuzzy import fuzz
I still get the error message:
UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
Unless it's just a case that packages can't use either/or because the name differs.
To be explicit:
python3.6 -m venv p3.6
source p3.6/bin/activate
pip install python-Levenshtein
Works. But...
python3.6 -m venv p3.6
source p3.6/bin/activate
pip install python-Levenshtein
Returns....
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/solebay/p3.8/bin/python3.8 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-k3gyeuus/python-levenshtein_b481a0d762974c65b15083869f89ea05/setup.py'"'"'; __file__='"'"'/tmp/pip-install-k3gyeuus/python-levenshtein_b481a0d762974c65b15083869f89ea05/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-fzop1uiz/install-record.txt --single-version-externally-managed --compile --install-headers /home/solebay/p3.8/include/site/python3.8/python-Levenshtein Check the logs for full command output.
Edit: This is my fault @maxbachmann.
A fresh environment (not an old one with modules deleted) , plus updated pip (and wheel enabled) meant that pip install leveshtein
works with 3.8
.
does anyone can help me? i use Windows.
got error like @woctezuma ...
Running setup.py install for python-Levenshtein ... error error: subprocess-exited-with-error
× Running setup.py install for python-Levenshtein did not run successfully.
│ exit code: 1
╰─> [27 lines of output]
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\Levenshtein
copying Levenshtein\StringMatcher.py -> build\lib.win-amd64-3.8\Levenshtein
copying Levenshtein__init__.py -> build\lib.win-amd64-3.8\Levenshtein
running egg_info
writing python_Levenshtein.egg-info\PKG-INFO
writing dependency_links to python_Levenshtein.egg-info\dependency_links.txt
writing entry points to python_Levenshtein.egg-info\entry_points.txt
writing namespace_packages to python_Levenshtein.egg-info\namespace_packages.txt
writing requirements to python_Levenshtein.egg-info\requires.txt
writing top-level names to python_Levenshtein.egg-info\top_level.txt
reading manifest file 'python_Levenshtein.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching 'pyc' found anywhere in distribution
warning: no previously-included files matching 'so' found anywhere in distribution
warning: no previously-included files matching '.project' found anywhere in distribution
warning: no previously-included files matching '.pydevproject' found anywhere in distribution
writing manifest file 'python_Levenshtein.egg-info\SOURCES.txt'
copying Levenshtein_levenshtein.c -> build\lib.win-amd64-3.8\Levenshtein
copying Levenshtein_levenshtein.h -> build\lib.win-amd64-3.8\Levenshtein
running build_ext
building 'Levenshtein._levenshtein' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure
× Encountered error while trying to install package. ╰─> python-Levenshtein
note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.
does anyone can help me? i use Windows.
https://github.com/ztane/python-Levenshtein/issues/58#issuecomment-757693558
TQ @woctezuma . GiulioRossetti already answer me in #189 https://github.com/GiulioRossetti/cdlib/issues/189
i try to to install MS Visual C++ >= 14 properly. Hopefully it works.