Docker python3:找不到''uu main\'modu

2024-04-30 03:42:33 发布

您现在位置:Python中文网/ 问答频道 /正文

当我跑的时候

docker-compose up --build

我得到以下错误:

web_1  | /opt/conda/bin/python3: can't find '__main__' module in 'glm-plotter'

glm绘图仪/glm-绘图仪.py公司名称:

^{pr2}$

Dockerfile文件

FROM continuumio/miniconda3
RUN apt-get update && apt-get install -y \
    libpq-dev \
    build-essential
RUN apt-get install -y python3
RUN apt-get install -y python3-pip

ADD . /code
WORKDIR /code
RUN pip3 install -r requirements.txt

RUN cd glm-plotter
RUN ls glm-plotter
CMD ["python3", "glm-plotter"]

Tags: installcomposedockerrunbuildwebget错误
1条回答
网友
1楼 · 发布于 2024-04-30 03:42:33

如果glm plotter引用this存储库,那么根据它的文档,您应该运行 python glm-plotter.py。在

因此,您应该将Dockerfile更改为:

CMD ["python3", "glm-plotter.py"]

相关问题 更多 >