【问题标题】:pip killed when installing requirements安装要求时 pip 被杀死
【发布时间】:2019-06-21 16:27:52
【问题描述】:

我正在将容器部署到 AWS 服务器上。我可以在我的笔记本电脑上构建容器没有问题,但是在实例上构建时,它在运行 pip install -r requirements.txt 时被杀死。

更多信息:

我已按照此处的建议检查了 var/log:pip install - killed 但没有日志输出。

实例有 2 个核心和 4G 内存

我的笔记本电脑有 4 个内核和 4G 内存

Running Top,CPU 使用率从一开始就飙升,就在它死机之前,ram 开始飙升。

我看到有人建议在 pip 上使用 no-cache。但关于这是否节省内存或硬盘空间存在相互矛盾的信息。

知道是什么原因造成的,我该如何处理?我以前从来没有遇到过点子崩溃。

Dockerfile:

FROM python:3.7
WORKDIR /requirements
Add . /requirements
RUN apt-get update && apt-get upgrade -y
RUN pip install --upgrade pip && pip install -r requirements.txt 

WORKDIR /application
EXPOSE 80
ENV CODING_LOCATION production
CMD python aex_training_controller.py -prs

requirements.txt(去掉一半后)

nltk==3.4
numpy==1.16.0
pandas==0.23.4
Pebble==4.3.9
git+https://github.com/boudinfl/pke.git
requests==2.21.0
seaborn==0.9.0
singledispatch==3.4.0.3
spacy==2.0.18
symspellpy==6.3.5
textblob==0.15.2

【问题讨论】:

    标签: python docker ubuntu pip


    【解决方案1】:

    我收到一个错误Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt' 此处未找到文件。
    我已将 Dockerfile 更新如下,它正在工作。

    FROM python:3.7
    COPY requirements requirements
    WORKDIR /requirements
    RUN apt-get update && apt-get upgrade -y
    RUN pip install --upgrade pip && pip install -r requirements.txt 
    
    WORKDIR /application
    EXPOSE 80
    ENV CODING_LOCATION production
    CMD python aex_training_controller.py -prs
    

    【讨论】:

      猜你喜欢
      • 2023-03-11
      • 2017-08-31
      • 2021-05-21
      • 2020-03-19
      • 2017-10-28
      • 1970-01-01
      • 2020-11-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多