经过几天的搜索,我准备放弃寻找 Python 2.7(Windows 64 位)的预编译二进制文件Python Levenshtein 库 http://pypi.python.org/pypi/python-Levenshtein/,所以不是我试图自己编译它。我已经安装了最新版本MinGW32(版本0.5-beta-20120426-1)并将其设置为默认编译器迪斯图尔斯.
开始了:
C:\Users\tomas>pip install python-levenshtein
Downloading/unpacking python-levenshtein
Running setup.py egg_info for package python-levenshtein
warning: no files found matching '*' under directory 'docs'
warning: no previously-included files matching '*pyc' 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
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\python27\lib\site-packages\setuptools-0.6c11-py2.7.egg (from python-levenshtein)
Installing collected packages: python-levenshtein
Running setup.py install for python-levenshtein
building 'Levenshtein' extension
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python27\include -IC:\Python27\PC -c Levenshtein.c -o build\temp.win-amd64-2.7\Release\levenshtein.o
cc1.exe: error: unrecognized command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1
Complete output from command C:\Python27\python.exe -c "import setuptools;__file__='c:\\users\\tomas\\appdata\\local\\temp\\pip-build\\python-levenshtein\\setup.py';exec(compile(open(__file__).rea
d().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\tomas\appdata\local\temp\pip-7txyhp-record\install-record.txt --single-version-externally-managed:
running install
running build
running build_ext
building 'Levenshtein' extension
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python27\include -IC:\Python27\PC -c Levenshtein.c -o build\temp.win-amd64-2.7\Release\levenshtein.o
cc1.exe: error: unrecognized command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1
现在我被困住了。我假设-mno-cygwin
选项已过时,对于以下版本不再有效gcc
我有。如果是这样的话,我仍然不知道如何解决这个问题。
感谢任何人可以就这个问题提供的任何帮助。
EDIT:
删除错误选项后,我手动运行编译行:
C:\MinGW\bin\gcc.exe -mdll -O -Wall -IC:\Python27\include -IC:\Python27\PC -c Levenshtein.c -o build\temp.win-amd64-2.7\Release\levenshtein.o
哪个成功提供了编辑网在构建文件夹中,但是当我尝试运行时python setup.py install
然后它只是尝试再次构建并失败。哪里可以删除-mno-cygwin
?我认为它在源头的某个地方迪斯图尔斯但我找不到它。
如果你使用 Anaconda,请尝试:
conda install -c conda-forge python-levenshtein
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)