kpu / kenlm

KenLM: Faster and Smaller Language Model Queries
http://kheafield.com/code/kenlm/
Other
2.5k stars 513 forks source link

cant install on windows 10 #235

Closed floweri closed 4 years ago

floweri commented 5 years ago

I cant install kenlm on windows 10. I am using pycharm and pip to install it.


(global_env) C:\Users\pc\PycharmProjects\helloworld>pip install kenlm Collecting kenlm Using cached https://files.pythonhosted.org/packages/57/54/0cc492b8d7aceb17a9164c6e6b9c9afc2c73706bb39324e8f6fa02f7134a/kenlm-0.tar.gz Building wheels for collected packages: kenlm Building wheel for kenlm (setup.py) ... error ERROR: Command errored out with exit status 1: command: 'c:\users\pc\pycharmprojects\global_env\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\pc\AppData\Local\Temp\pip-install-enbn64g7 \kenlm\setup.py'"'"'; file='"'"'C:\Users\pc\AppData\Local\Temp\pip-install-enbn64g7\kenlm\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().repla ce('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\pc\AppData\Local\Temp\pip-wheel-tkjfizyg' --python-tag cp37 cwd: C:\Users\pc\AppData\Local\Temp\pip-install-enbn64g7\kenlm\ Complete output (12 lines): running bdist_wheel running build running build_ext building 'kenlm' extension creating build\temp.win-amd64-3.7 creating build\temp.win-amd64-3.7\Release creating build\temp.win-amd64-3.7\Release\util creating build\temp.win-amd64-3.7\Release\lm creating build\temp.win-amd64-3.7\Release\util\double-conversion creating build\temp.win-amd64-3.7\Release\python cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -I. -Ic:\users\pc\pycharmprojects\global_env\include -IC:\Users\pc\AppData\Local\Programs\Python\Python37\include -IC:\Users\pc\AppData\Local\Pr ograms\Python\Python37\include /EHsc /Tputil\bit_packing.cc /Fobuild\temp.win-amd64-3.7\Release\util\bit_packing.obj -O3 -DNDEBUG -DKENLM_MAX_ORDER=6 -std=c++11 error: command 'cl.exe' failed: No such file or directory ERROR: Failed building wheel for kenlm Running setup.py clean for kenlm Failed to build kenlm Installing collected packages: kenlm Running setup.py install for kenlm ... error ERROR: Command errored out with exit status 1: command: 'c:\users\pc\pycharmprojects\global_env\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\pc\AppData\Local\Temp\pip-install-enbn64 g7\kenlm\setup.py'"'"'; file='"'"'C:\Users\pc\AppData\Local\Temp\pip-install-enbn64g7\kenlm\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().rep lace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\pc\AppData\Local\Temp\pip-record-rwnr4axd\install-record.txt' --single -version-externally-managed --compile --install-headers 'c:\users\pc\pycharmprojects\global_env\include\site\python3.7\kenlm' cwd: C:\Users\pc\AppData\Local\Temp\pip-install-enbn64g7\kenlm\ Complete output (12 lines): running install running build running build_ext building 'kenlm' extension creating build\temp.win-amd64-3.7 creating build\temp.win-amd64-3.7\Release creating build\temp.win-amd64-3.7\Release\util creating build\temp.win-amd64-3.7\Release\lm creating build\temp.win-amd64-3.7\Release\util\double-conversion creating build\temp.win-amd64-3.7\Release\python cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -I. -Ic:\users\pc\pycharmprojects\global_env\include -IC:\Users\pc\AppData\Local\Programs\Python\Python37\include -IC:\Users\pc\AppData\Local\ Programs\Python\Python37\include /EHsc /Tputil\bit_packing.cc /Fobuild\temp.win-amd64-3.7\Release\util\bit_packing.obj -O3 -DNDEBUG -DKENLM_MAX_ORDER=6 -std=c++11 error: command 'cl.exe' failed: No such file or directory

ERROR: Command errored out with exit status 1: 'c:\users\pc\pycharmprojects\global_env\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\pc\AppData \Local\Temp\pip-install-enbn64g7\kenlm\setup.py'"'"'; file='"'"'C:\Users\pc\AppData\Local\Temp\pip-install-enbn64g7\kenlm\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\pc\AppData\Local\Temp\pip-record-rwnr 4axd\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\pc\pycharmprojects\global_env\include\site\python3.7\kenlm' Check the logs for full comman d output.

Hamahmi commented 5 years ago

Using Visual Studio, build kenlm project first, then build_binary and ngram_query as mentioned in BUILD file. When building kenlm project if teh error ('max' : is not a member of 'std' ) in pool.cc just put #incude in the start of the file .

87

kpu commented 5 years ago

@Hamahmi #include <algorithm> has been in pool.cc for 4 years: https://github.com/kpu/kenlm/blame/f39edc306026a9bce47249b30a0a4e68bfbd6fa4/util/pool.cc#L7

Hamahmi commented 5 years ago

@kpu I didn't see that, I downloaded the release as suggested in the READme and it wasn't there

kpu commented 4 years ago

Sounds like this is fixed and the website has a more recent version.