python numba安装失败_Dockerfile因numba安装失败而出现llvm-config错误

My Dockerfile using a pypy base fails with FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config' when installing llvmlite, a dependency of numba which is listed in my requirements.txt

My error in more detail:

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'

I don't want the heavy weight of a conda installation. Is there a way to achieve a numba install for pypy without it?

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

I expect a clean build of the docker image with numba on pypy

解决方案

WORKAROUND If the error appeared after April the 17th (they released a new version, see history).

As a workaround try installing a previous version

pip3 install llvmlite==0.31.0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值