gpt4 book ai didi

Dockerfile 因 numba 安装的 llvm-config 错误而失败

转载 作者:行者123 更新时间:2023-12-02 18:01:59 26 4
gpt4 key购买 nike

我使用 pypy 基础的 Dockerfile 失败,出现 FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config' when install llvmlite,numba 的依赖项,在我的 requirements.txt 中列出

我尝试遵循并更新此处的说明
Python numba / llvmlite on Debian 8 - i can't build llvmlite

我的错误更详细:

Building wheels for collected packages: llvmlite
Building wheel for llvmlite (setup.py): started
Building wheel for llvmlite (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/pypy3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ux49fegr/llvmlite/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ux49fegr/llvmlite/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-8s6wwump --python-tag pp371
cwd: /tmp/pip-install-ux49fegr/llvmlite/
Complete output (26 lines):
running bdist_wheel
/usr/local/bin/pypy3 /tmp/pip-install-ux49fegr/llvmlite/ffi/build.py
LLVM version... Traceback (most recent call last):
File "/tmp/pip-install-ux49fegr/llvmlite/ffi/build.py", line 105, in main_posix
out = subprocess.check_output([llvm_config, '--version'])
File "/usr/local/lib-python/3/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/usr/local/lib-python/3/subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/local/lib-python/3/subprocess.py", line 722, in __init__
restore_signals, start_new_session)
File "/usr/local/lib-python/3/subprocess.py", line 1354, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config'

我不想要 conda 安装的重量。有没有办法在没有它的情况下为 pypy 实现 numba 安装?
FROM pypy:3.6-slim-stretch

RUN apt-get update && apt-get install -y gnupg wget software-properties-common
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - 15CF4D18AF4F7421
RUN apt-add-repository "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-6.0 main"
RUN apt-get update
RUN apt-get -y install cython python-llvm build-essential libedit-dev
RUN apt-get -y install libllvm6.0 llvm-6.0-dev llvm-dev

RUN pip install enum34
ENV LLVM_CONFIG=/usr/lib/llvm-6.0-dev/bin/llvm-config pip install llvmlite
ENV LLVM_CONFIG=/usr/lib/llvm-6.0-dev/bin/llvm-config pip install numba
# ENV LD_LIBRARY_PATH /usr/lib/llvm-6.0-dev/lib/

#... other stuff

RUN apt-get clean && apt-get -y update
RUN apt-get -y install python3-dev \
&& apt-get -y install build-essential

# Add requirements
COPY requirements.txt /tmp/

# Install sphinx first as it does not work inside requirements
RUN pip install -U pip && pip install -U sphinx && pip install numpy && pip install cython && \
pip install -r /tmp/requirements.txt

我希望在 pypy 上使用 numba 干净地构建 docker 镜像

最佳答案

解决方法 如果错误出现在 4 月 17 日之后(他们发布了新版本,请参阅 history)。
作为解决方法,请尝试安装以前的版本

pip3 install llvmlite==0.31.0

关于Dockerfile 因 numba 安装的 llvm-config 错误而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58353351/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com