WojciechMula / pyahocorasick

Python module (C extension and plain python) implementing Aho-Corasick algorithm
BSD 3-Clause "New" or "Revised" License
927 stars 122 forks source link

cl.exe failed with exit status 2 #131

Closed oppppp closed 3 years ago

oppppp commented 3 years ago

hello, i've been trying to install the package using the method, pip install git+https://github.com/WojciechMula/pyahocorasick . Because i need to use the method iter_long, and the package released in pypi does not have the api . But when i execute the pip command, i've got the error message like below:

C:\Users\Admin\AppData\Local\Temp\pip-req-build-2zuj7qu0\Automaton.c(1038): warning C4244: “函数”: 从“ssize_t”转换到“int”,可能丢失数据 C:\Users\Admin\AppData\Local\Temp\pip-req-build-2zuj7qu0\Automaton.c(1040): warning C4244: “函数”: 从“ssize_t”转换到“int”,可能丢失数据 C:\Users\Admin\AppData\Local\Temp\pip-req-build-2zuj7qu0\Automaton_pickle.c(363): warning C4018: “<”: 有符号/无符号 不匹配 C:\Users\Admin\AppData\Local\Temp\pip-req-build-2zuj7qu0\Automaton_pickle.c(422): warning C4018: “<”: 有符号/无符号 不匹配 C:\Users\Admin\AppData\Local\Temp\pip-req-build-2zuj7qu0\Automaton_pickle.c(473): warning C4018: “<”: 有符号/无符号 不匹配 C:\Users\Admin\AppData\Local\Temp\pip-req-build-2zuj7qu0\Automaton_pickle.c(483): warning C4018: “<”: 有符号/无符号 不匹配 C:\Users\Admin\AppData\Local\Temp\pip-req-build-2zuj7qu0\AutomatonSearchIterLong.c(202): warning C4244: “=”: 从“ssize_t”转换到“int”,可能丢失数据 C:\Users\Admin\AppData\Local\Temp\pip-req-build-2zuj7qu0\AutomatonSearchIterLong.c(230): error C2099: 初始值设定项不是常量 C:\Users\Admin\AppData\Local\Temp\pip-req-build-2zuj7qu0\src/custompickle/load/loadbuffer.c(68): warning C4146: 一元负运算符应用于无符号类型,结果仍为无符号类型 C:\Users\Admin\AppData\Local\Temp\pip-req-build-2zuj7qu0\src/custompickle/load/module_automaton_load.c(89): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe' failed with exit status 2

i've tried to reinstall microsoft visual c++ tools and reset the environment variable VS140COMNTOOLS, but it's still wrong. so if anybody do know how to solve the problem, please help, many thanks~!

WojciechMula commented 3 years ago

Thanks for the report, I see that everything broke with the latest Visual Studio version. Can anybody help with this?

WojciechMula commented 3 years ago

I believe it was fixed with #139