iryna-kondr / scikit-llm

Seamlessly integrate LLMs into scikit-learn.
https://beastbyte.ai/
MIT License
3.38k stars 275 forks source link

Failed building wheel for annoy In scikit-llm[gpt4all] #40

Closed reddyprasade closed 1 year ago

reddyprasade commented 1 year ago

Building wheels for collected packages: annoy Building wheel for annoy (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [19 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.10 creating build\lib.win-amd64-3.10\annoy copying annoy__init.py -> build\lib.win-amd64-3.10\annoy copying annoy\init__.pyi -> build\lib.win-amd64-3.10\annoy copying annoy\py.typed -> build\lib.win-amd64-3.10\annoy running build_ext building 'annoy.annoylib' extension creating build\temp.win-amd64-3.10 creating build\temp.win-amd64-3.10\Release creating build\temp.win-amd64-3.10\Release\src C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\sumeruinfra\AppData\Local\Programs\Python\Python310\include -IC:\Users\sumeruinfra\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include /EHsc /Tpsrc/annoymodule.cc /Fobuild\temp.win-amd64-3.10\Release\src/annoymodule.obj -D_CRT_SECURE_NO_WARNINGS -fpermissive -DANNOYLIB_MULTITHREADED_BUILD cl : Command line warning D9002 : ignoring unknown option '-fpermissive' annoymodule.cc C:\Users\sumeruinfra\AppData\Local\Temp\pip-install-risjy5ab\annoy_0f7489caf9de4e62a7376c32e7609982\src\annoylib.h(19): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\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 annoy Running setup.py clean for annoy Failed to build annoy ERROR: Could not build wheels for annoy, which is required to install pyproject.toml-based projects

OKUA1 commented 1 year ago

Seems like there is an issue with the CPP compiler in your environment. Can you try to pip install annoy directly just in case (I assume you will get the same error). If so, it is better to open an issue with annoy devs as it doesn't seem to be directly related to scikit-llm. https://github.com/spotify/annoy

Prayforhanluo commented 1 year ago

annoy can not be installed due to gcc version. For me, It's hard and unrobust to change the gcc version for system. Is annoy a necessary and irreplaceable package for scikit-llm?

OKUA1 commented 1 year ago

@Prayforhanluo at the moment annoy is the only index that can be used by DynamicFewShot estimator. However, we probably could make it an optional dependency and go with something like sklearn KNN by default. We will consider this for the next release.

reddyprasade commented 1 year ago

Seems like there is an issue with the CPP compiler in your environment. Can you try to pip install annoy directly just in case (I assume you will get the same error). If so, it is better to open an issue with annoy devs as it doesn't seem to be directly related to scikit-llm. https://github.com/spotify/annoy

Same Issues If we Install Dependence Packages

reddyprasade commented 1 year ago

pip install annoy WARNING: Ignoring invalid distribution -rotobuf (c:\users\sumeruinfra\appdata\local\programs\python\python310\lib\site-packages) WARNING: Ignoring invalid distribution -ymongo (c:\users\sumeruinfra\appdata\local\programs\python\python310\lib\site-packages) Collecting annoy Using cached annoy-1.17.3.tar.gz (647 kB) Preparing metadata (setup.py) ... done Building wheels for collected packages: annoy Building wheel for annoy (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [19 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.10 creating build\lib.win-amd64-3.10\annoy copying annoy__init.py -> build\lib.win-amd64-3.10\annoy copying annoy\init__.pyi -> build\lib.win-amd64-3.10\annoy copying annoy\py.typed -> build\lib.win-amd64-3.10\annoy running build_ext building 'annoy.annoylib' extension creating build\temp.win-amd64-3.10 creating build\temp.win-amd64-3.10\Release creating build\temp.win-amd64-3.10\Release\src C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\sumeruinfra\AppData\Local\Programs\Python\Python310\include -IC:\Users\sumeruinfra\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include /EHsc /Tpsrc/annoymodule.cc /Fobuild\temp.win-amd64-3.10\Release\src/annoymodule.obj -D_CRT_SECURE_NO_WARNINGS -fpermissive -DANNOYLIB_MULTITHREADED_BUILD cl : Command line warning D9002 : ignoring unknown option '-fpermissive' annoymodule.cc C:\Users\sumeruinfra\AppData\Local\Temp\pip-install-_z1x63lg\annoy_7c08e48d9418499c876cb0133458a99b\src\annoylib.h(19): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\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 annoy Running setup.py clean for annoy Failed to build annoy ERROR: Could not build wheels for annoy, which is required to install pyproject.toml-based projects

[notice] A new release of pip is available: 23.1.2 -> 23.2 [notice] To update, run: python.exe -m pip install --upgrade pip