且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Docker无法安装numpy,scipy或gensim

更新时间:2023-02-26 19:19:29

要安装numpy,scipy或gensim ,需要在 RUN pip install -r requirements.txt 之前将以下行添加到Dockerfile:

To install numpy, scipy, or gensim, the following lines need to be added to the Dockerfile before RUN pip install -r requirements.txt:

RUN apt-get -y install libc-dev
RUN apt-get -y install build-essential
RUN pip install -U pip

前两行安装了库所需的C构建工具。 tihrd行将pip升级到最新的可用版本。

The first two lines install the C build tools required for the libraries. The tihrd line upgrades pip to the newest available version.