如何修复 Dockerfile numba 安装错误:ERROR: Dependency OpenBLAS not found
问题
在 Docker 构建期间,使用 pip install numba 或类似命令安装 numba 包时遇到以下错误:
openblas_dependency_error.txt
../scipy/meson.build:216:9: ERROR: Dependency "OpenBLAS" not found, tried pkgconfig解决方案
你需要在容器中安装 gfortran 包:
install_openblas.sh
sudo apt -y install libopenblas-dev将以下行添加到你的 Dockerfile(适用于基于 deb 的发行版):
Dockerfile_add_openblas
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y gfortran libopenblas-dev && rm -rf /var/lib/apt/lists/*除了 gfortran 外,还需要 gfortran-dev 来构建 numba。
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow