salesforce / logai

LogAI - An open-source library for log analytics and intelligence
BSD 3-Clause "New" or "Revised" License
456 stars 66 forks source link

Error during logai install command - Getting requirements to build wheel ... error ; error: subprocess-exited-with-error #80

Open Tixi3 opened 1 month ago

Tixi3 commented 1 month ago

I want to run Logai locally via VSCode. I positioned myself to logai folder, set up the environment and when I try "pip3 install logai" command, I receive the following error. I tried to solve it with following commands: pip3 install --upgrade pip setuptools wheel Cython pip3 install --no-build-isolation logai pip3 install --no-cache-dir logai pip3 install --no-build-isolation logai pip3 install --prefer-binary logai and nothing worked, I always receive the same error.

This is the error: Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [67 lines of output]

:19: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html :53: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. :56: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. :53: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. Error compiling Cython file: ------------------------------------------------------------ ... cimport cython cimport numpy as np import numpy as np ctypedef np.float64_t DOUBLE ctypedef np.int_t INT ^ ------------------------------------------------------------ statsmodels\nonparametric\linbin.pyx:13:9: 'int_t' is not a type identifier Compiling statsmodels/tsa/_stl.pyx because it changed. Compiling statsmodels/tsa/holtwinters/_exponential_smoothers.pyx because it changed. Compiling statsmodels/tsa/exponential_smoothing/_ets_smooth.pyx because it changed. Compiling statsmodels/tsa/_innovations.pyx because it changed. Compiling statsmodels/tsa/regime_switching/_hamilton_filter.pyx because it changed. Compiling statsmodels/tsa/regime_switching/_kim_smoother.pyx because it changed. Compiling statsmodels/tsa/innovations/_arma_innovations.pyx because it changed. Compiling statsmodels/nonparametric/linbin.pyx because it changed. Compiling statsmodels/robust/_qn.pyx because it changed. Compiling statsmodels/nonparametric/_smoothers_lowess.pyx because it changed. Compiling statsmodels/tsa/statespace/_initialization.pyx because it changed. Compiling statsmodels/tsa/statespace/_representation.pyx because it changed. Compiling statsmodels/tsa/statespace/_kalman_filter.pyx because it changed. Compiling statsmodels/tsa/statespace/_filters/_conventional.pyx because it changed. Compiling statsmodels/tsa/statespace/_filters/_inversions.pyx because it changed. Compiling statsmodels/tsa/statespace/_filters/_univariate.pyx because it changed. Compiling statsmodels/tsa/statespace/_filters/_univariate_diffuse.pyx because it changed. Compiling statsmodels/tsa/statespace/_kalman_smoother.pyx because it changed. Compiling statsmodels/tsa/statespace/_smoothers/_alternative.pyx because it changed. Compiling statsmodels/tsa/statespace/_smoothers/_classical.pyx because it changed. Compiling statsmodels/tsa/statespace/_smoothers/_conventional.pyx because it changed. Compiling statsmodels/tsa/statespace/_smoothers/_univariate.pyx because it changed. Compiling statsmodels/tsa/statespace/_smoothers/_univariate_diffuse.pyx because it changed. Compiling statsmodels/tsa/statespace/_simulation_smoother.pyx because it changed. Compiling statsmodels/tsa/statespace/_cfa_simulation_smoother.pyx because it changed. Compiling statsmodels/tsa/statespace/_tools.pyx because it changed. [ 1/26] Cythonizing statsmodels/nonparametric/_smoothers_lowess.pyx [ 2/26] Cythonizing statsmodels/nonparametric/linbin.pyx Traceback (most recent call last): File "C:\Users\uie44461\develop\AI_tools\logai\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in main() File "C:\Users\uie44461\develop\AI_tools\logai\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "C:\Users\uie44461\develop\AI_tools\logai\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) File "C:\Users\uie44461\AppData\Local\Temp\pip-build-env-auutofc1\overlay\Lib\site-packages\setuptools\build_meta.py", line 332, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) File "C:\Users\uie44461\AppData\Local\Temp\pip-build-env-auutofc1\overlay\Lib\site-packages\setuptools\build_meta.py", line 302, in _get_build_requires self.run_setup() File "C:\Users\uie44461\AppData\Local\Temp\pip-build-env-auutofc1\overlay\Lib\site-packages\setuptools\build_meta.py", line 516, in run_setup super().run_setup(setup_script=setup_script) File "C:\Users\uie44461\AppData\Local\Temp\pip-build-env-auutofc1\overlay\Lib\site-packages\setuptools\build_meta.py", line 318, in run_setup exec(code, locals()) File "", line 304, in File "C:\Users\uie44461\AppData\Local\Temp\pip-build-env-auutofc1\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1154, in cythonize cythonize_one(*args) File "C:\Users\uie44461\AppData\Local\Temp\pip-build-env-auutofc1\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1321, in cythonize_one raise CompileError(None, pyx_file) Cython.Compiler.Errors.CompileError: statsmodels/nonparametric/linbin.pyx [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip.
aandino commented 3 weeks ago

Hi, we had been the same problem. It was solutioned using python version 3.9.20 using pyenv.

DatadudeDev commented 2 days ago

pip install logai in a fresh venv yeilds a flurry of errors. I found that uninstalling statsmodels, numpy, and scipy then defining explicit versions in a constraints.txt did the trick.

contents of ./constraints.txt:

numpy==1.23.5 cython==0.29.36 scipy==1.10.1 statsmodels==0.14.2

run the installation with this command:

pip install --no-cache-dir --constraint constraints.txt logai