0
我正在使用Docker構建我的應用程序。我使用pip從requirements.txt
安裝軟件包,但該軟件包不包含在構建中。ImportError:在Docker中沒有使用pip命名包的模塊
FROM python:3.4
WORKDIR /app
ADD . /app
RUN apt-get update && apt-get install -y \
python3-pip python-pip\
cron \
unixodbc \
unixodbc-dev \
python3-dev \
python3-setuptools \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip
RUN pip install sendgrid
RUN pip3 install -r requirements.txt
ENV CONFIG_ENV .env
ADD validator-cron /etc/cron.d/validator-cron-job
RUN chmod 0644 /etc/cron.d/validator-cron-job
RUN touch /var/log/cron.log
CMD cron && tail -f /var/log/cron.log
我使用PIP安裝sendgrid
但我得到ImportError: no module found error
。
是您的錯誤消息'ImportError:沒有模塊名爲package'或'ImportError:no module found error'? 'requirements.txt'的內容是什麼? – pchaigno