Closed tpanza closed 2 years ago
Hi @tpanza Thank you for reporting the bug as well as proposing a solution! If you want, you can update the version in the below files and raise a PR. I will merge and release the change.
As there is no stable release for editdistance
, please use the specific version (here 0.6.0).
Hi
Wanted to check if this error had been resolved as I was getting this exact error on Python 3.11. Following that I downloaded and installed Microsoft Visual C++ 14.0 as well, but am getting the below error now instead.
Building wheels for collected packages: editdistance
Building wheel for editdistance (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [30 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\editdistance
copying editdistance\__init__.py -> build\lib.win-amd64-cpython-311\editdistance
copying editdistance\_editdistance.h -> build\lib.win-amd64-cpython-311\editdistance
copying editdistance\def.h -> build\lib.win-amd64-cpython-311\editdistance
running build_ext
building 'editdistance.bycython' extension
creating build\temp.win-amd64-cpython-311
creating build\temp.win-amd64-cpython-311\Release
creating build\temp.win-amd64-cpython-311\Release\editdistance
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -I./editdistance "-IC:\Users\gaurav.daftary_pures\My Drive\project_files\test\include" -IC:\Users\gaurav.daftary_pures\AppData\Local\Programs\Python\Python311\include -IC:\Users\gaurav.daftary_pures\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" /EHsc /Tpeditdistance/_editdistance.cpp /Fobuild\temp.win-amd64-cpython-311\Release\editdistance/_editdistance.obj
_editdistance.cpp
editdistance/_editdistance.cpp(92): warning C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data
editdistance/_editdistance.cpp(120): note: see reference to function template instantiation 'unsigned int edit_distance_map_<1>(const int64_t *,const size_t,const int64_t *,const size_t)' being compiled
editdistance/_editdistance.cpp(93): warning C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data
editdistance/_editdistance.cpp(44): warning C4018: '<=': signed/unsigned mismatch
editdistance/_editdistance.cpp(98): note: see reference to function template instantiation 'unsigned int edit_distance_bpv<cmap_v,varr<1>>(T &,const int64_t *,const size_t &,const unsigned int &,const unsigned int &)' being compiled
with
[
T=cmap_v
]
editdistance/_editdistance.cpp(120): note: see reference to function template instantiation 'unsigned int edit_distance_map_<1>(const int64_t *,const size_t,const int64_t *,const size_t)' being compiled
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -I./editdistance "-IC:\Users\gaurav.daftary_pures\My Drive\project_files\test\include" -IC:\Users\gaurav.daftary_pures\AppData\Local\Programs\Python\Python311\include -IC:\Users\gaurav.daftary_pures\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" /EHsc /Tpeditdistance/bycython.cpp /Fobuild\temp.win-amd64-cpython-311\Release\editdistance/bycython.obj
bycython.cpp
editdistance/bycython.cpp(216): fatal error C1083: Cannot open include file: 'longintrepr.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.36.32532\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for editdistance
Running setup.py clean for editdistance
Failed to build editdistance
ERROR: Could not build wheels for editdistance, which is required to install pyproject.toml-based projects
Describe the bug A Windows user running Python 3.8 or 3.9 cannot successfully run
pip install contextualSpellCheck
. (Unless Microsoft C++ Build Tools has been installed ahead of time.)To Reproduce
Expected behavior Installation to succeed on Windows for Python 3.8 or 3.9, without having to install Microsoft C++ Build Tools.
Version (please complete the following information):
Additional information
The
setup.py
script forcontextualSpellCheck
has itseditdistance
dependency pinned to version 0.5.3. That release of editdistance only has prebuilt binary wheels for up to Python 3.7.A newer release of
editdistance
, 0.6.0, contains no code changes but includes binary wheels for more versions of Python (up to 3.9).So if the
editdistance
dependency version were simply relaxed to something like>= 0.5.3
or~= 0.5
, thenpip
would find the 0.6.0 release and use those pre-built binary wheels. Since there are no underlying code changes to that release ofeditdistance
, that would be a simple and low-risk change forcontextualSpellCheck
.