Fix Python/pip installation in CUDA image
Browse files- Dockerfile +11 -3
Dockerfile
CHANGED
|
@@ -6,15 +6,23 @@ WORKDIR /app
|
|
| 6 |
ENV OMP_NUM_THREADS=4
|
| 7 |
ENV MKL_NUM_THREADS=4
|
| 8 |
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
| 9 |
|
| 10 |
-
# Install Python and
|
| 11 |
RUN apt-get update && apt-get install -y \
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
python3.11 \
|
| 13 |
-
python3-pip \
|
| 14 |
python3.11-venv \
|
|
|
|
|
|
|
| 15 |
git \
|
| 16 |
&& rm -rf /var/lib/apt/lists/* \
|
| 17 |
-
&& ln -sf /usr/bin/python3.11 /usr/bin/python
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# Copy requirements and install
|
| 20 |
COPY requirements.txt .
|
|
|
|
| 6 |
ENV OMP_NUM_THREADS=4
|
| 7 |
ENV MKL_NUM_THREADS=4
|
| 8 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 9 |
+
ENV PATH="/usr/local/bin:$PATH"
|
| 10 |
|
| 11 |
+
# Install Python 3.11 and pip properly
|
| 12 |
RUN apt-get update && apt-get install -y \
|
| 13 |
+
software-properties-common \
|
| 14 |
+
&& add-apt-repository -y ppa:deadsnakes/ppa \
|
| 15 |
+
&& apt-get update \
|
| 16 |
+
&& apt-get install -y \
|
| 17 |
python3.11 \
|
|
|
|
| 18 |
python3.11-venv \
|
| 19 |
+
python3.11-distutils \
|
| 20 |
+
curl \
|
| 21 |
git \
|
| 22 |
&& rm -rf /var/lib/apt/lists/* \
|
| 23 |
+
&& ln -sf /usr/bin/python3.11 /usr/bin/python \
|
| 24 |
+
&& ln -sf /usr/bin/python3.11 /usr/bin/python3 \
|
| 25 |
+
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
|
| 26 |
|
| 27 |
# Copy requirements and install
|
| 28 |
COPY requirements.txt .
|