Python levenshtein ошибка при установке

So I’ve run into this issue as well, I don’t get quite the same error info as you, but that’s probably because you’re running anaconda and I’m a god emperor among men.

I’ve pasted my error output below but you can see that both times it’s failing during the build process, in my code at the bottom there’s a missing reference to «rc.exe» which is used to compile resources from a resource list.

Well it turns out that python-Levenshtein is looking for rc.exe in the wrong folder. I googled around and found this answer from stackoverflow, the solution was this:

  • Copy (do not cut) rc.exe and rcdll.dll from C:Program Files (x86)Windows Kits8.1binx86
  • Paste them into ~PathToMicrosoft Visual Studio 14.0VCbinamd64_x86
  • Copy and paste cvtres.exe from ~PathToMicrosoft Visual Studio 14.0VCbin into ~PathToMicrosoft Visual Studio 14.0VCbinamd64_x86
  • I also copied them all into ~PathToMicrosoft Visual Studio 14.0VCbinx86_amd64 because those two paths are very similar.

Now you can pip install python-Levenshtein and it should work!

Here’s my output logs:

running install
running build
running build_py
creating build
creating buildlib.win-amd64-3.6
creating buildlib.win-amd64-3.6Levenshtein
copying LevenshteinStringMatcher.py -> buildlib.win-amd64-3.6Levenshtein
copying Levenshtein__init__.py -> buildlib.win-amd64-3.6Levenshtein
running egg_info
writing python_Levenshtein.egg-infoPKG-INFO
writing dependency_links to python_Levenshtein.egg-infodependency_links.txt
writing entry points to python_Levenshtein.egg-infoentry_points.txt
writing namespace_packages to python_Levenshtein.egg-infonamespace_packages.txt
writing requirements to python_Levenshtein.egg-inforequires.txt
writing top-level names to python_Levenshtein.egg-infotop_level.txt
warning: manifest_maker: standard file '-c' not found

reading manifest file 'python_Levenshtein.egg-infoSOURCES.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-infoSOURCES.txt'
copying Levenshtein_levenshtein.c -> buildlib.win-amd64-3.6Levenshtein
copying Levenshtein_levenshtein.h -> buildlib.win-amd64-3.6Levenshtein
running build_ext
building 'Levenshtein._levenshtein' extension
creating buildtemp.win-amd64-3.6
creating buildtemp.win-amd64-3.6Release
creating buildtemp.win-amd64-3.6ReleaseLevenshtein
C:Program Files (x86)Microsoft Visual Studio 14.0VCBINx86_amd64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-IC:Program FilesPython36include" "-IC:Program FilesPython36include" "-IC:Program Files (x86)Microsoft Visual Studio 14.0VCINCLUDE" "-IC:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCINCLUDE" "-IC:Program Files (x86)Windows Kits10include10.0.15063.0ucrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" "-IC:Program Files (x86)Windows Kits10include10.0.15063.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.15063.0um" "-IC:Program Files (x86)Windows Kits10include10.0.15063.0winrt" /TcLevenshtein/_levenshtein.c /Fobuildtemp.win-amd64-3.6ReleaseLevenshtein/_levenshtein.obj
_levenshtein.c
Levenshtein/_levenshtein.c(714): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data
Levenshtein/_levenshtein.c(719): warning C4267: 'return': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(732): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data
Levenshtein/_levenshtein.c(737): warning C4267: 'return': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(798): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(814): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(1379): warning C4101: 'len': unreferenced local variable
Levenshtein/_levenshtein.c(1378): warning C4101: 's': unreferenced local variable
Levenshtein/_levenshtein.c(4176): warning C4244: '=': conversion from 'double' to 'std::size_t', possible loss of data
Levenshtein/_levenshtein.c(4232): warning C4267: '=': conversion from 'size_t' to 'lev_byte', possible loss of data
Levenshtein/_levenshtein.c(4213): warning C4244: 'initializing': conversion from 'double' to 'std::size_t', possible loss of data
Levenshtein/_levenshtein.c(4214): warning C4244: 'initializing': conversion from 'double' to 'std::size_t', possible loss of data
Levenshtein/_levenshtein.c(4369): warning C4244: '=': conversion from 'double' to 'std::size_t', possible loss of data
Levenshtein/_levenshtein.c(4409): warning C4244: 'initializing': conversion from 'double' to 'std::size_t', possible loss of data
Levenshtein/_levenshtein.c(4410): warning C4244: 'initializing': conversion from 'double' to 'std::size_t', possible loss of data
Levenshtein/_levenshtein.c(4520): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(4534): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(4593): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(4607): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data
Levenshtein/_levenshtein.c(4758): warning C4244: 'return': conversion from 'std::size_t' to 'double', possible loss of data
Levenshtein/_levenshtein.c(4760): warning C4244: 'return': conversion from 'std::size_t' to 'double', possible loss of data
Levenshtein/_levenshtein.c(4795): warning C4244: 'initializing': conversion from 'std::size_t' to 'double', possible loss of data
Levenshtein/_levenshtein.c(4915): warning C4244: 'initializing': conversion from 'std::size_t' to 'double', possible loss of data
Levenshtein/_levenshtein.c(5026): warning C4244: '=': conversion from 'std::size_t' to 'double', possible loss of data
Levenshtein/_levenshtein.c(5126): warning C4244: '=': conversion from 'std::size_t' to 'double', possible loss of data
C:Program Files (x86)Microsoft Visual Studio 14.0VCBINx86_amd64link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO "/LIBPATH:C:Program FilesPython36libs" "/LIBPATH:C:Program FilesPython36PCbuildamd64" "/LIBPATH:C:Program Files (x86)Microsoft Visual Studio 14.0VCLIBamd64" "/LIBPATH:C:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCLIBamd64" "/LIBPATH:C:Program Files (x86)Windows Kits10lib10.0.15063.0ucrtx64" "/LIBPATH:C:Program Files (x86)Windows KitsNETFXSDK4.6.1libumx64" "/LIBPATH:C:Program Files (x86)Windows Kits10lib10.0.15063.0umx64" /EXPORT:PyInit__levenshtein buildtemp.win-amd64-3.6ReleaseLevenshtein/_levenshtein.obj /OUT:buildlib.win-amd64-3.6Levenshtein_levenshtein.cp36-win_amd64.pyd /IMPLIB:buildtemp.win-amd64-3.6ReleaseLevenshtein_levenshtein.cp36-win_amd64.lib
Creating library buildtemp.win-amd64-3.6ReleaseLevenshtein_levenshtein.cp36-win_amd64.lib and object buildtemp.win-amd64-3.6ReleaseLevenshtein_levenshtein.cp36-win_amd64.exp
Generating code
Finished generating code
LINK : fatal error LNK1158: cannot run 'rc.exe'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe' failed with exit status 1158

----------------------------------------
Command ""C:Program FilesPython36python.exe" -u -c "import setuptools, tokenize;__file__='C:\Users\Greg\AppData\Local\Temp\pip-build-3otnt7hw\python-Levenshtein\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersGregAppDataLocalTemppip-5b70wzr_-recordinstall-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:UsersGregAppDataLocalTemppip-build-3otnt7hwpython-Levenshtein

  • todem

Мне выдаёт вот такую ошибку:

Collecting python-Levenshtein
Using cached python-Levenshtein-0.12.2.tar.gz (50 kB)
Requirement already satisfied: setuptools in f:programmingpython3.9.2libsite-packages (from python-Levenshtein) (54.1.2)
Using legacy ‘setup.py install’ for python-Levenshtein, since package ‘wheel’ is not installed.
Installing collected packages: python-Levenshtein
Running setup.py install for python-Levenshtein … error
ERROR: Command errored out with exit status 1:
command: ‘f:programmingpython3.9.2python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘C:\Users\1rock\AppData\Local\Temp\pip-install-v7rixp21\python-levenshtein_296ba8f7b4fa4d5fbe7b7a9bc0014935\setup.py'»‘»‘; __file__='»‘»‘C:\Users\1rock\AppData\Local\Temp\pip-install-v7rixp21\python-levenshtein_296ba8f7b4fa4d5fbe7b7a9bc0014935\setup.py'»‘»‘;f=getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(__file__);code=f.read().replace(‘»‘»‘rn'»‘»‘, ‘»‘»‘n'»‘»‘);f.close();exec(compile(code, __file__, ‘»‘»‘exec'»‘»‘))’ install —record ‘C:Users1rockAppDataLocalTemppip-record-__ri7h2ainstall-record.txt’ —single-version-externally-managed —compile —install-headers ‘f:programmingpython3.9.2Includepython-Levenshtein’
cwd: C:Users1rockAppDataLocalTemppip-install-v7rixp21python-levenshtein_296ba8f7b4fa4d5fbe7b7a9bc0014935
Complete output (27 lines):
running install
running build
running build_py
creating build
creating buildlib.win-amd64-3.9
creating buildlib.win-amd64-3.9Levenshtein
copying LevenshteinStringMatcher.py -> buildlib.win-amd64-3.9Levenshtein
copying Levenshtein__init__.py -> buildlib.win-amd64-3.9Levenshtein
running egg_info
writing python_Levenshtein.egg-infoPKG-INFO
writing dependency_links to python_Levenshtein.egg-infodependency_links.txt
writing entry points to python_Levenshtein.egg-infoentry_points.txt
writing namespace_packages to python_Levenshtein.egg-infonamespace_packages.txt
writing requirements to python_Levenshtein.egg-inforequires.txt
writing top-level names to python_Levenshtein.egg-infotop_level.txt
reading manifest file ‘python_Levenshtein.egg-infoSOURCES.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-infoSOURCES.txt’
copying Levenshtein_levenshtein.c -> buildlib.win-amd64-3.9Levenshtein
copying Levenshtein_levenshtein.h -> buildlib.win-amd64-3.9Levenshtein
running build_ext
building ‘Levenshtein._levenshtein’ extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with «Microsoft C++ Build Tools»: https://visualstudio.microsoft.com/visual-cpp-buil…
—————————————-
ERROR: Command errored out with exit status 1: ‘f:programmingpython3.9.2python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘C:\Users\1rock\AppData\Local\Temp\pip-install-v7rixp21\python-levenshtein_296ba8f7b4fa4d5fbe7b7a9bc0014935\setup.py'»‘»‘; __file__='»‘»‘C:\Users\1rock\AppData\Local\Temp\pip-install-v7rixp21\python-levenshtein_296ba8f7b4fa4d5fbe7b7a9bc0014935\setup.py'»‘»‘;f=getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(__file__);code=f.read().replace(‘»‘»‘rn'»‘»‘, ‘»‘»‘n'»‘»‘);f.close();exec(compile(code, __file__, ‘»‘»‘exec'»‘»‘))’ install —record ‘C:Users1rockAppDataLocalTemppip-record-__ri7h2ainstall-record.txt’ —single-version-externally-managed —compile —install-headers ‘f:programmingpython3.9.2Includepython-Levenshtein’ Check the logs for full command output.

Что делать?


  • Вопрос задан

    более двух лет назад

  • 2812 просмотров

error: Microsoft Visual C++ 14.0 or greater is required. Get it with «Microsoft C++ Build Tools»:

Там даже ссылка есть на скачивание.

Пригласить эксперта

Если есть Анаконда, то всё просто в командной строке от Анаконды пишешь следующее
«conda install -c conda-forge python-levenshtein»
мне помогло)


  • Показать ещё
    Загружается…

04 июн. 2023, в 12:23

30000 руб./за проект

04 июн. 2023, в 12:18

20000 руб./за проект

04 июн. 2023, в 12:07

2000 руб./за проект

Минуточку внимания

I’m trying to install the python-Levenshtein library on linux, but whenever I try to install it via:

sudo pip install python-Levenshtein

I get this error:

Command «/usr/bin/python -c «import setuptools, tokenize;file=’/tmp/pip-build-LAmG4b/python-Levenshtein/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —record /tmp/pip-KGiQPH-record/install-record.txt —single-version-externally-managed —compile» failed with error code 1 in /tmp/pip-build-LAmG4b/python-Levenshtein

And the error code: error: command ‘gcc’ failed with exit status 1

I’m using debian linux.

Mikko Ohtamaa's user avatar

Mikko Ohtamaa

81.3k49 gold badges259 silver badges428 bronze badges

asked Sep 15, 2015 at 20:29

Jaf's user avatar

5

One of the python-Levenshtein maintainers here.

Make sure you have python-dev and build-essential packages.

Are you sure that’s full error message as the actual error seem to be missing?

If a log file is created can you peek into it and add its content to the question.

Also read the official Python package installation guide. Use virtual environments. Never do sudo pip install unless you have a specific reason to do so.

answered Sep 15, 2015 at 20:51

Mikko Ohtamaa's user avatar

Mikko OhtamaaMikko Ohtamaa

81.3k49 gold badges259 silver badges428 bronze badges

3

Just in case if anyone will encounter the same issue as the author of this question:

I faced the same issue on Ubuntu 20.04. I wanted to use a library which depends on python-Levenstein.

Mikkos answer above was correct. When installing, I have obtained further line in the end of exception:
'x86_64-linux-gnu-gcc' failed with exit status 1
which directly means a problem with building tool.

Then I found this answer by Paulie

Overall, in my case it was simply executing:
sudo apt-get install python3.7-dev

Then I installed the library using:

pip install python-Levenshtein

I hope this will be clear for everyone.

answered Apr 28, 2020 at 13:16

Aidos's user avatar

AidosAidos

7297 silver badges20 bronze badges

I had a similar error when installing python-Levenshtein and I was able to install it like this:

pip install conda
conda install -c conda-forge python-levenshtein

Chris's user avatar

Chris

126k99 gold badges269 silver badges250 bronze badges

answered Aug 18, 2022 at 17:44

Wallisson França's user avatar

Please excuse me if this is the wrong forum. Would appreciate a pointer to the right place, if this is not it.

On Mac OS Big Sur v. 11.6.5. Using the latest python 3 version updated today via Homebrew. In a virtual environment installing with pip install cltk and pip3 install cltk, I get the following error.

(cltk) MacBook-Pro:python_virt fyrmest$ pip3 install cltk
Collecting cltk
Using cached cltk-1.0.24-py3-none-any.whl (845 kB)
Collecting python-Levenshtein<0.13.0,>=0.12.0
Using cached python-Levenshtein-0.12.2.tar.gz (50 kB)
Preparing metadata (setup.py) … done
Collecting scikit-learn<0.25.0,>=0.24.2
Using cached scikit_learn-0.24.2-cp39-cp39-macosx_10_13_x86_64.whl (7.3 MB)
Collecting gitpython<4.0,>=3.0
Using cached GitPython-3.1.27-py3-none-any.whl (181 kB)
Collecting nltk<4.0,>=3.5
Using cached nltk-3.7-py3-none-any.whl (1.5 MB)
Collecting requests<3.0.0,>=2.22.0
Using cached requests-2.27.1-py2.py3-none-any.whl (63 kB)
Collecting fasttext<0.10.0,>=0.9.1
Using cached fasttext-0.9.2.tar.gz (68 kB)
Preparing metadata (setup.py) … done
Collecting boltons<21.0.0,>=20.0.0
Using cached boltons-20.2.1-py2.py3-none-any.whl (170 kB)
Collecting spacy<3.0.0,>=2.3.5
Using cached spacy-2.3.7-cp39-cp39-macosx_10_9_x86_64.whl (10.1 MB)
Collecting gensim<4.0.0,>=3.8.1
Using cached gensim-3.8.3.tar.gz (23.4 MB)
Preparing metadata (setup.py) … done
Collecting greek-accentuation<2.0.0,>=1.2.0
Using cached greek_accentuation-1.2.0-py2.py3-none-any.whl (6.8 kB)
Collecting PyYAML<6.0.0,>=5.4.1
Using cached PyYAML-5.4.1-cp39-cp39-macosx_10_9_x86_64.whl (259 kB)
Collecting stringcase<2.0,>=1.2
Using cached stringcase-1.2.0-py3-none-any.whl
Collecting stanza<2.0.0,>=1.3.0
Using cached stanza-1.3.0-py3-none-any.whl (432 kB)
Collecting tqdm<5.0.0,>=4.41.1
Using cached tqdm-4.64.0-py2.py3-none-any.whl (78 kB)
Collecting pybind11>=2.2
Using cached pybind11-2.9.2-py2.py3-none-any.whl (213 kB)
Requirement already satisfied: setuptools>=0.7.0 in ./cltk/lib/python3.9/site-packages (from fasttext<0.10.0,>=0.9.1->cltk) (60.10.0)
Collecting numpy
Using cached numpy-1.22.3-cp39-cp39-macosx_10_14_x86_64.whl (17.6 MB)
Collecting scipy>=0.18.1
Using cached scipy-1.8.0-cp39-cp39-macosx_12_0_universal2.macosx_10_9_x86_64.whl (55.6 MB)
Collecting six>=1.5.0
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting smart_open>=1.8.1
Using cached smart_open-5.2.1-py3-none-any.whl (58 kB)
Collecting gitdb<5,>=4.0.1
Using cached gitdb-4.0.9-py3-none-any.whl (63 kB)
Collecting click
Using cached click-8.1.2-py3-none-any.whl (96 kB)
Collecting regex>=2021.8.3
Using cached regex-2022.3.15-cp39-cp39-macosx_10_9_x86_64.whl (288 kB)
Collecting joblib
Using cached joblib-1.1.0-py2.py3-none-any.whl (306 kB)
Collecting charset-normalizer~=2.0.0
Using cached charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
Collecting urllib3<1.27,>=1.21.1
Using cached urllib3-1.26.9-py2.py3-none-any.whl (138 kB)
Collecting certifi>=2017.4.17
Using cached certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
Collecting idna<4,>=2.5
Using cached idna-3.3-py3-none-any.whl (61 kB)
Collecting threadpoolctl>=2.0.0
Using cached threadpoolctl-3.1.0-py3-none-any.whl (14 kB)
Collecting wasabi<1.1.0,>=0.4.0
Using cached wasabi-0.9.1-py3-none-any.whl (26 kB)
Collecting plac<1.2.0,>=0.9.6
Using cached plac-1.1.3-py2.py3-none-any.whl (20 kB)
Collecting blis<0.8.0,>=0.4.0
Using cached blis-0.7.7-cp39-cp39-macosx_10_9_x86_64.whl (5.8 MB)
Collecting srsly<1.1.0,>=1.0.2
Using cached srsly-1.0.5-cp39-cp39-macosx_10_9_x86_64.whl (179 kB)
Collecting cymem<2.1.0,>=2.0.2
Using cached cymem-2.0.6-cp39-cp39-macosx_10_9_x86_64.whl (32 kB)
Collecting preshed<3.1.0,>=3.0.2
Using cached preshed-3.0.6-cp39-cp39-macosx_10_9_x86_64.whl (106 kB)
Collecting catalogue<1.1.0,>=0.0.7
Using cached catalogue-1.0.0-py2.py3-none-any.whl (7.7 kB)
Collecting murmurhash<1.1.0,>=0.28.0
Using cached murmurhash-1.0.6-cp39-cp39-macosx_10_9_x86_64.whl (18 kB)
Collecting thinc<7.5.0,>=7.4.1
Using cached thinc-7.4.5-cp39-cp39-macosx_10_9_x86_64.whl (992 kB)
Collecting torch>=1.3.0
Using cached torch-1.11.0-cp39-none-macosx_10_9_x86_64.whl (129.9 MB)
Collecting protobuf
Using cached protobuf-3.20.0-cp39-cp39-macosx_10_9_x86_64.whl (962 kB)
Collecting emoji
Using cached emoji-1.7.0-py3-none-any.whl
Collecting smmap<6,>=3.0.1
Using cached smmap-5.0.0-py3-none-any.whl (24 kB)
Collecting typing-extensions
Using cached typing_extensions-4.1.1-py3-none-any.whl (26 kB)
Using legacy ‘setup.py install’ for fasttext, since package ‘wheel’ is not installed.
Using legacy ‘setup.py install’ for gensim, since package ‘wheel’ is not installed.
Using legacy ‘setup.py install’ for python-Levenshtein, since package ‘wheel’ is not installed.
Installing collected packages: wasabi, stringcase, srsly, plac, murmurhash, greek-accentuation, emoji, cymem, certifi, boltons, urllib3, typing-extensions, tqdm, threadpoolctl, smmap, smart_open, six, regex, PyYAML, python-Levenshtein, pybind11, protobuf, preshed, numpy, joblib, idna, click, charset-normalizer, catalogue, torch, scipy, requests, nltk, gitdb, fasttext, blis, thinc, stanza, scikit-learn, gitpython, gensim, spacy, cltk
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
╰─> [34 lines of output]
running install
/Users/fyrmest/python_virt/cltk/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.macosx-11-x86_64-3.9
creating build/lib.macosx-11-x86_64-3.9/Levenshtein
copying Levenshtein/StringMatcher.py -> build/lib.macosx-11-x86_64-3.9/Levenshtein
copying Levenshtein/init.py -> build/lib.macosx-11-x86_64-3.9/Levenshtein
running egg_info
writing python_Levenshtein.egg-info/PKG-INFO
writing dependency_links to python_Levenshtein.egg-info/dependency_links.txt
deleting 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
adding license file ‘COPYING’
writing manifest file ‘python_Levenshtein.egg-info/SOURCES.txt’
copying Levenshtein/_levenshtein.c -> build/lib.macosx-11-x86_64-3.9/Levenshtein
copying Levenshtein/_levenshtein.h -> build/lib.macosx-11-x86_64-3.9/Levenshtein
running build_ext
building ‘Levenshtein._levenshtein’ extension
creating build/temp.macosx-11-x86_64-3.9
creating build/temp.macosx-11-x86_64-3.9/Levenshtein
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/fyrmest/python_virt/cltk/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c Levenshtein/_levenshtein.c -o build/temp.macosx-11-x86_64-3.9/Levenshtein/_levenshtein.o
clang: error: invalid version number in ‘MACOSX_DEPLOYMENT_TARGET=11’
error: command ‘/usr/bin/clang’ failed with exit code 1
[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.

Trying to install «python-Levenshtein» on Windows

EDIT: SOLVED: I missed the part of the error where it said I needed to install Visual C++ for Python 2.7. DOYYY. I’ll leave this up anyway in case anyone else ever has this problem

I’m trying to use Chatterbot. When I run…

from chatterbot import ChatBot
from chatterbot.training.trainers import ChatterBotCorpusTrainer

chatbot = ChatBot("Ron Obvious")
chatbot.set_trainer(ChatterBotCorpusTrainer)

# Train based on the english corpus
chatbot.train("chatterbot.corpus.english")

# Get a response to an input statement
chatbot.get_response("Hello, how are you today?")

… I get the following error:

«Warning (from warnings module): File «C:Python27libsite-packagesfuzzywuzzyfuzz.py», line 35 warnings.warn(‘Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning’) UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning»

So I tried «pip install python-Levenshtein» in CMD and it fails:

«Collecting python-Levenshtein Using cached python-Levenshtein-0.12.0.tar.gz Requirement already satisfied (use —upgrade to upgrade): setuptools in c:python27libsite-packages (from python-Levenshtein) Building wheels for collected packages: python-Levenshtein Running setup.py bdist_wheel for python-Levenshtein … error Complete output from command c:python27python.exe -u -c «import setuptools, tokenize;_file__=’c:usersconnorappdatalocaltemppip-build-bkzelkpython-Levenshteinsetup.py’;exec(compile(getattr(tokenize, ‘open’, open)(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» bdist_wheel -d c:usersconnorappdatalocaltemptmpudxbevpip-wheel- —python-tag cp27: running bdist_wheel running build running build_py creating build creating buildlib.win32-2.7 creating buildlib.win32-2.7Levenshtein copying LevenshteinStringMatcher.py -> buildlib.win32-2.7Levenshtein copying Levenshtein_init.py -> buildlib.win32-2.7Levenshtein running egg_info writing requirements to python_Levenshtein.egg-inforequires.txt writing python_Levenshtein.egg-infoPKG-INFO writing namespace_packages to python_Levenshtein.egg-infonamespace_packages.txt writing top-level names to python_Levenshtein.egg-infotop_level.txt writing dependency_links to python_Levenshtein.egg-infodependency_links.txt writing entry points to python_Levenshtein.egg-infoentry_points.txt warning: manifest_maker: standard file ‘-c’ not found

reading manifest file ‘python_Levenshtein.egg-infoSOURCES.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-infoSOURCES.txt’ copying Levenshtein_levenshtein.c -> buildlib.win32-2.7Levenshtein copying Levenshtein_levenshtein.h -> buildlib.win32-2.7Levenshtein running build_ext building ‘Levenshtein._levenshtein’ extension error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27


Failed building wheel for python-Levenshtein Running setup.py clean for python-Levenshtein Failed to build python-Levenshtein Installing collected packages: python-Levenshtein Running setup.py install for python-Levenshtein … error Complete output from command c:python27python.exe -u -c «import setuptools, tokenize;_file__=’c:usersconnorappdatalocaltemppip-build-bkzelkpython-Levenshteinsetup.py’;exec(compile(getattr(tokenize, ‘open’, open)(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —record c:usersconnorappdatalocaltemppip-tjwfcn-recordinstall-record.txt —single-version-externally-managed —compile: running install running build running build_py creating build creating buildlib.win32-2.7 creating buildlib.win32-2.7Levenshtein copying LevenshteinStringMatcher.py -> buildlib.win32-2.7Levenshtein copying Levenshtein_init.py -> buildlib.win32-2.7Levenshtein running egg_info writing requirements to python_Levenshtein.egg-inforequires.txt writing python_Levenshtein.egg-infoPKG-INFO writing namespace_packages to python_Levenshtein.egg-infonamespace_packages.txt writing top-level names to python_Levenshtein.egg-infotop_level.txt writing dependency_links to python_Levenshtein.egg-infodependency_links.txt writing entry points to python_Levenshtein.egg-infoentry_points.txt warning: manifest_maker: standard file ‘-c’ not found

reading manifest file 'python_Levenshtein.egg-infoSOURCES.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-infoSOURCES.txt'
copying Levenshtein_levenshtein.c -> buildlib.win32-2.7Levenshtein
copying Levenshtein_levenshtein.h -> buildlib.win32-2.7Levenshtein
running build_ext
building 'Levenshtein._levenshtein' extension
error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27

----------------------------------------

Command «c:python27python.exe -u -c «import setuptools, tokenize;__file__=’c:usersconnorappdatalocaltemppip-build-bkzelkpython-Levenshteinsetup.py’;exec(compile(getattr(tokenize, ‘open’, open)(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —record c:usersconnorappdatalocaltemppip-tjwfcn-recordinstall-record.txt —single-version-externally-managed —compile» failed with error code 1 in c:usersconnorappdatalocaltemppip-build-bkzelkpython-Levenshtein»

Is python- Levenshtein only for Linux or what? I’m super confused.

Понравилась статья? Поделить с друзьями:
  • Python int обработка ошибок
  • Python exe ошибка при запуске приложения 0xc000007b
  • Python exception как получить текст ошибки
  • Python exception вывести ошибку
  • Pyscripter ошибка при запуске