Skip to content

Commit 6695635

Browse files
authored
upgrade to python 3.10 in the Dockerfiles (#7893)
* upgrade to python 3.10 * fix * try https://askubuntu.com/questions/1459694/can-not-find-python3-10-after-apt-get-installation * fix * up * yes * okay * up * up * up * up * up * check * okay * up * i[ * fix
1 parent b934215 commit 6695635

File tree

13 files changed

+92
-69
lines changed

13 files changed

+92
-69
lines changed

docker/diffusers-flax-cpu/Dockerfile

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,25 @@ LABEL repository="diffusers"
44

55
ENV DEBIAN_FRONTEND=noninteractive
66

7-
RUN apt update && \
8-
apt install -y bash \
9-
build-essential \
10-
git \
11-
git-lfs \
12-
curl \
13-
ca-certificates \
14-
libsndfile1-dev \
15-
libgl1 \
16-
python3.8 \
17-
python3-pip \
18-
python3.8-venv && \
7+
RUN apt-get -y update \
8+
&& apt-get install -y software-properties-common \
9+
&& add-apt-repository ppa:deadsnakes/ppa
10+
11+
RUN apt install -y bash \
12+
build-essential \
13+
git \
14+
git-lfs \
15+
curl \
16+
ca-certificates \
17+
libsndfile1-dev \
18+
libgl1 \
19+
python3.10 \
20+
python3-pip \
21+
python3.10-venv && \
1922
rm -rf /var/lib/apt/lists
2023

2124
# make sure to use venv
22-
RUN python3 -m venv /opt/venv
25+
RUN python3.10 -m venv /opt/venv
2326
ENV PATH="/opt/venv/bin:$PATH"
2427

2528
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)

docker/diffusers-flax-tpu/Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,25 @@ LABEL repository="diffusers"
44

55
ENV DEBIAN_FRONTEND=noninteractive
66

7-
RUN apt update && \
8-
apt install -y bash \
7+
RUN apt-get -y update \
8+
&& apt-get install -y software-properties-common \
9+
&& add-apt-repository ppa:deadsnakes/ppa
10+
11+
RUN apt install -y bash \
912
build-essential \
1013
git \
1114
git-lfs \
1215
curl \
1316
ca-certificates \
1417
libsndfile1-dev \
1518
libgl1 \
16-
python3.8 \
19+
python3.10 \
1720
python3-pip \
18-
python3.8-venv && \
21+
python3.10-venv && \
1922
rm -rf /var/lib/apt/lists
2023

2124
# make sure to use venv
22-
RUN python3 -m venv /opt/venv
25+
RUN python3.10 -m venv /opt/venv
2326
ENV PATH="/opt/venv/bin:$PATH"
2427

2528
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)

docker/diffusers-onnxruntime-cpu/Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,25 @@ LABEL repository="diffusers"
44

55
ENV DEBIAN_FRONTEND=noninteractive
66

7-
RUN apt update && \
8-
apt install -y bash \
7+
RUN apt-get -y update \
8+
&& apt-get install -y software-properties-common \
9+
&& add-apt-repository ppa:deadsnakes/ppa
10+
11+
RUN apt install -y bash \
912
build-essential \
1013
git \
1114
git-lfs \
1215
curl \
1316
ca-certificates \
1417
libsndfile1-dev \
1518
libgl1 \
16-
python3.8 \
19+
python3.10 \
1720
python3-pip \
18-
python3.8-venv && \
21+
python3.10-venv && \
1922
rm -rf /var/lib/apt/lists
2023

2124
# make sure to use venv
22-
RUN python3 -m venv /opt/venv
25+
RUN python3.10 -m venv /opt/venv
2326
ENV PATH="/opt/venv/bin:$PATH"
2427

2528
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)

docker/diffusers-onnxruntime-cuda/Dockerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,36 @@ LABEL repository="diffusers"
44

55
ENV DEBIAN_FRONTEND=noninteractive
66

7-
RUN apt update && \
8-
apt install -y bash \
7+
RUN apt-get -y update \
8+
&& apt-get install -y software-properties-common \
9+
&& add-apt-repository ppa:deadsnakes/ppa
10+
11+
RUN apt install -y bash \
912
build-essential \
1013
git \
1114
git-lfs \
1215
curl \
1316
ca-certificates \
1417
libsndfile1-dev \
1518
libgl1 \
16-
python3.8 \
19+
python3.10 \
1720
python3-pip \
18-
python3.8-venv && \
21+
python3.10-venv && \
1922
rm -rf /var/lib/apt/lists
2023

2124
# make sure to use venv
22-
RUN python3 -m venv /opt/venv
25+
RUN python3.10 -m venv /opt/venv
2326
ENV PATH="/opt/venv/bin:$PATH"
2427

2528
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
26-
RUN python3 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
27-
python3 -m uv pip install --no-cache-dir \
29+
RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
30+
python3.10 -m uv pip install --no-cache-dir \
2831
torch \
2932
torchvision \
3033
torchaudio \
3134
"onnxruntime-gpu>=1.13.1" \
3235
--extra-index-url https://download.pytorch.org/whl/cu117 && \
33-
python3 -m uv pip install --no-cache-dir \
36+
python3.10 -m uv pip install --no-cache-dir \
3437
accelerate \
3538
datasets \
3639
hf-doc-builder \

docker/diffusers-pytorch-compile-cuda/Dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,35 @@ LABEL repository="diffusers"
44

55
ENV DEBIAN_FRONTEND=noninteractive
66

7-
RUN apt update && \
8-
apt install -y bash \
7+
RUN apt-get -y update \
8+
&& apt-get install -y software-properties-common \
9+
&& add-apt-repository ppa:deadsnakes/ppa
10+
11+
RUN apt install -y bash \
912
build-essential \
1013
git \
1114
git-lfs \
1215
curl \
1316
ca-certificates \
1417
libsndfile1-dev \
1518
libgl1 \
16-
python3.9 \
17-
python3.9-dev \
19+
python3.10 \
1820
python3-pip \
19-
python3.9-venv && \
21+
python3.10-venv && \
2022
rm -rf /var/lib/apt/lists
2123

2224
# make sure to use venv
23-
RUN python3.9 -m venv /opt/venv
25+
RUN python3.10 -m venv /opt/venv
2426
ENV PATH="/opt/venv/bin:$PATH"
2527

2628
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
27-
RUN python3.9 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
28-
python3.9 -m uv pip install --no-cache-dir \
29+
RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
30+
python3.10 -m uv pip install --no-cache-dir \
2931
torch \
3032
torchvision \
3133
torchaudio \
3234
invisible_watermark && \
33-
python3.9 -m pip install --no-cache-dir \
35+
python3.10 -m pip install --no-cache-dir \
3436
accelerate \
3537
datasets \
3638
hf-doc-builder \

docker/diffusers-pytorch-cpu/Dockerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,36 @@ LABEL repository="diffusers"
44

55
ENV DEBIAN_FRONTEND=noninteractive
66

7-
RUN apt update && \
8-
apt install -y bash \
7+
RUN apt-get -y update \
8+
&& apt-get install -y software-properties-common \
9+
&& add-apt-repository ppa:deadsnakes/ppa
10+
11+
RUN apt install -y bash \
912
build-essential \
1013
git \
1114
git-lfs \
1215
curl \
1316
ca-certificates \
1417
libsndfile1-dev \
15-
python3.8 \
18+
python3.10 \
1619
python3-pip \
1720
libgl1 \
18-
python3.8-venv && \
21+
python3.10-venv && \
1922
rm -rf /var/lib/apt/lists
2023

2124
# make sure to use venv
22-
RUN python3 -m venv /opt/venv
25+
RUN python3.10 -m venv /opt/venv
2326
ENV PATH="/opt/venv/bin:$PATH"
2427

2528
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
26-
RUN python3 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
27-
python3 -m uv pip install --no-cache-dir \
29+
RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
30+
python3.10 -m uv pip install --no-cache-dir \
2831
torch \
2932
torchvision \
3033
torchaudio \
3134
invisible_watermark \
3235
--extra-index-url https://download.pytorch.org/whl/cpu && \
33-
python3 -m uv pip install --no-cache-dir \
36+
python3.10 -m uv pip install --no-cache-dir \
3437
accelerate \
3538
datasets \
3639
hf-doc-builder \

docker/diffusers-pytorch-cuda/Dockerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,35 @@ LABEL repository="diffusers"
44

55
ENV DEBIAN_FRONTEND=noninteractive
66

7-
RUN apt update && \
8-
apt install -y bash \
7+
RUN apt-get -y update \
8+
&& apt-get install -y software-properties-common \
9+
&& add-apt-repository ppa:deadsnakes/ppa
10+
11+
RUN apt install -y bash \
912
build-essential \
1013
git \
1114
git-lfs \
1215
curl \
1316
ca-certificates \
1417
libsndfile1-dev \
1518
libgl1 \
16-
python3.8 \
19+
python3.10 \
1720
python3-pip \
18-
python3.8-venv && \
21+
python3.10-venv && \
1922
rm -rf /var/lib/apt/lists
2023

2124
# make sure to use venv
22-
RUN python3 -m venv /opt/venv
25+
RUN python3.10 -m venv /opt/venv
2326
ENV PATH="/opt/venv/bin:$PATH"
2427

2528
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
26-
RUN python3 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
27-
python3 -m uv pip install --no-cache-dir \
29+
RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
30+
python3.10 -m uv pip install --no-cache-dir \
2831
torch \
2932
torchvision \
3033
torchaudio \
3134
invisible_watermark && \
32-
python3 -m pip install --no-cache-dir \
35+
python3.10 -m pip install --no-cache-dir \
3336
accelerate \
3437
datasets \
3538
hf-doc-builder \

docker/diffusers-pytorch-xformers-cuda/Dockerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,35 @@ LABEL repository="diffusers"
44

55
ENV DEBIAN_FRONTEND=noninteractive
66

7-
RUN apt update && \
8-
apt install -y bash \
7+
RUN apt-get -y update \
8+
&& apt-get install -y software-properties-common \
9+
&& add-apt-repository ppa:deadsnakes/ppa
10+
11+
RUN apt install -y bash \
912
build-essential \
1013
git \
1114
git-lfs \
1215
curl \
1316
ca-certificates \
1417
libsndfile1-dev \
1518
libgl1 \
16-
python3.8 \
19+
python3.10 \
1720
python3-pip \
18-
python3.8-venv && \
21+
python3.10-venv && \
1922
rm -rf /var/lib/apt/lists
2023

2124
# make sure to use venv
22-
RUN python3 -m venv /opt/venv
25+
RUN python3.10 -m venv /opt/venv
2326
ENV PATH="/opt/venv/bin:$PATH"
2427

2528
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
26-
RUN python3 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
27-
python3 -m pip install --no-cache-dir \
29+
RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
30+
python3.10 -m pip install --no-cache-dir \
2831
torch \
2932
torchvision \
3033
torchaudio \
3134
invisible_watermark && \
32-
python3 -m uv pip install --no-cache-dir \
35+
python3.10 -m uv pip install --no-cache-dir \
3336
accelerate \
3437
datasets \
3538
hf-doc-builder \

docs/source/en/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pip install -e ".[flax]"
112112

113113
These commands will link the folder you cloned the repository to and your Python library paths.
114114
Python will now look inside the folder you cloned to in addition to the normal library paths.
115-
For example, if your Python packages are typically installed in `~/anaconda3/envs/main/lib/python3.8/site-packages/`, Python will also search the `~/diffusers/` folder you cloned to.
115+
For example, if your Python packages are typically installed in `~/anaconda3/envs/main/lib/python3.10/site-packages/`, Python will also search the `~/diffusers/` folder you cloned to.
116116

117117
<Tip warning={true}>
118118

docs/source/ja/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pip install -e ".[flax]"
106106

107107
これらのコマンドは、リポジトリをクローンしたフォルダと Python のライブラリパスをリンクします。
108108
Python は通常のライブラリパスに加えて、クローンしたフォルダの中を探すようになります。
109-
例えば、Python パッケージが通常 `~/anaconda3/envs/main/lib/python3.8/site-packages/` にインストールされている場合、Python はクローンした `~/diffusers/` フォルダも同様に参照します。
109+
例えば、Python パッケージが通常 `~/anaconda3/envs/main/lib/python3.10/site-packages/` にインストールされている場合、Python はクローンした `~/diffusers/` フォルダも同様に参照します。
110110

111111
<Tip warning={true}>
112112

0 commit comments

Comments
 (0)