admin管理员组文章数量:1402059
I am trying to run the following in dockerfile using the ubuntu:latest image, but I am getting an error.
# Use an official Ubuntu base image
FROM ubuntu:latest
# Install Python and dependencies - not really needed as ubuntu:latest has python3 pre-installed
# RUN apt update
# RUN apt install -y python3 python3-pip
# Set working directory
WORKDIR /app
# Copy files into the container
COPY requirements.txt .
COPY main.py .
# Install required Python packages
# RUN python3-pip install -r requirements.txt
RUN pip3 install -r requirements.txt
# RUN python3 -m pip install -r requirements.txt
# RUN pip install -r requirements.txt
# Define entrypoint
ENTRYPOINT ["python3", "main.py"]
I don't know what I have done wrong but I just can't run pip install - even though I have tried all the variations - python3-pip, pip3, python3 -m pip, pip, etc...
Here is an extract of the log:
#7 [2/5] WORKDIR /app
#7 DONE 0.0s
#8 [3/5] COPY requirements.txt .
#8 DONE 0.0s
#9 [4/5] COPY main.py .
#9 DONE 0.0s
#10 [5/5] RUN pip3 install -r requirements.txt
#10 0.162 /bin/sh: 1: pip3: not found
#10 ERROR: process "/bin/sh -c pip3 install -r requirements.txt" did not complete successfully: exit code: 127
------
> [5/5] RUN pip3 install -r requirements.txt:
0.162 /bin/sh: 1: pip3: not found
------
Dockerfile:17
--------------------
14 |
15 | # Install required Python packages
16 | # RUN python3-pip install -r requirements.txt
17 | >>> RUN pip3 install -r requirements.txt
18 | # RUN python3 -m pip install -r requirements.txt
19 | # RUN pip install -r requirements.txt
--------------------
ERROR: failed to solve: process "/bin/sh -c pip3 install -r requirements.txt" did not complete successfully: exit code: 127
本文标签: pythondocker buildpip3 not foundStack Overflow
版权声明:本文标题:python - docker build - pip3 not found - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744339550a2601395.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论