установка scikit-learn: ОШИБКА: Команда выполнена с ошибкой со статусом выхода 1:

#python #scikit-learn

Вопрос:

Мне нужно установить конкретную (старую) версию scikit-learn вместе с другими требованиями проекта. Я использую Python3.9. Установка scikit-learn продолжает отказывать, но из сообщения об ошибке я не могу понять, в чем проблема.

Требования:

 Shapely==1.6.4.post2
numpy==1.19.5
botocore==1.12.68
requests==2.26.0
opencv_python_headless==4.5.1.48
loguru==0.5.3
pika==1.1.0
pandas==1.3.3
tqdm==4.62.3
pytz==2021.1
coloredlogs==15.0.1
boto3==1.9.68
AWSIoTPythonSDK==1.4.9
filterpy==1.4.5
Flask==2.0.1
flask_cors==3.0.10
numba==0.41.0
llvmlite==0.26.0
scikit-learn==0.20.1
 
     Running setup.py install for llvmlite: started
    Running setup.py install for llvmlite: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-zs1d0gqg/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-zs1d0gqg/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-v0wusznu/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/llvmlite
         cwd: /tmp/pip-req-build-zs1d0gqg/
    Complete output (29 lines):
    running install
    running build
    got version from file /tmp/pip-req-build-zs1d0gqg/llvmlite/_version.py {'version': '0.26.0', 'full': 'f63f7b0b67bfc159a9cc4e6a9728c67f8c690825'}
    running build_ext
    /usr/local/bin/python /tmp/pip-req-build-zs1d0gqg/ffi/build.py
    LLVM version... Traceback (most recent call last):
      File "/tmp/pip-req-build-zs1d0gqg/ffi/build.py", line 105, in main_posix
        out = subprocess.check_output([llvm_config, '--version'])
      File "/usr/local/lib/python3.9/subprocess.py", line 424, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "/usr/local/lib/python3.9/subprocess.py", line 505, in run
        with Popen(*popenargs, **kwargs) as process:
      File "/usr/local/lib/python3.9/subprocess.py", line 951, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "/usr/local/lib/python3.9/subprocess.py", line 1821, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/tmp/pip-req-build-zs1d0gqg/ffi/build.py", line 167, in <module>
        main()
      File "/tmp/pip-req-build-zs1d0gqg/ffi/build.py", line 157, in main
        main_posix('linux', '.so')
      File "/tmp/pip-req-build-zs1d0gqg/ffi/build.py", line 107, in main_posix
        raise RuntimeError("%s failed executing, please point LLVM_CONFIG "
    RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config
    error: command '/usr/local/bin/python' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-zs1d0gqg/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-zs1d0gqg/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-v0wusznu/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/llvmlite Check the logs for full command output.
 

Я уже установил llvm с apt-get install llvm

Комментарии:

1. Вы установили llvm-dev ?

2. llvmlite 0.26.0 не совместим с python 3.9 см. pypi.org/project/llvmlite/0.26.0 , только llvmlite 0.36 и выше работает с python 3.9