python version split polish
frdel committed
Sep 23, 2025 at 14:10 UTC
1c966b6769500b87794f12c9cd72fb697f263d58
3 files changed
+43
-68
docker/base/Dockerfile
-3
@@ -24,9 +24,6 @@ RUN bash /ins/install_base_packages2.sh
24
RUN bash /ins/install_base_packages3.sh
25
RUN bash /ins/install_base_packages4.sh
26
27
-# install pyenv
28
-RUN bash /ins/install_pyenv.sh
29
-
27
# install python after packages to ensure version overriding
28
RUN bash /ins/install_python.sh
29
docker/base/fs/ins/install_pyenv.sh
deleted
-34
@@ -1,34 +0,0 @@
1
-#!/bin/bash
2
-set -e
3
-
4
-echo "====================PYENV START===================="
5
-
6
-# Install pyenv build dependencies.
7
-apt-get install -y --no-install-recommends \
8
- make build-essential libssl-dev zlib1g-dev libbz2-dev \
9
- libreadline-dev libsqlite3-dev wget curl llvm \
10
- libncursesw5-dev xz-utils tk-dev libxml2-dev \
11
- libxmlsec1-dev libffi-dev liblzma-dev
12
-
13
-# Install pyenv globally
14
-git clone https://github.com/pyenv/pyenv.git /opt/pyenv
15
-
16
-# Setup environment variables for pyenv to be available system-wide
17
-cat > /etc/profile.d/pyenv.sh <<'EOF'
18
-export PYENV_ROOT="/opt/pyenv"
19
-export PATH="$PYENV_ROOT/bin:$PATH"
20
-eval "$(pyenv init --path)"
21
-EOF
22
-
23
-chmod +x /etc/profile.d/pyenv.sh
24
-
25
-# Source pyenv environment to make it available in this script
26
-source /etc/profile.d/pyenv.sh
27
-
28
-# Install Python 3.12.4
29
-echo "====================PYENV INSTALLING PYTHON 3.12.4===================="
30
-pyenv install 3.12.4
31
-
32
-/opt/pyenv/versions/3.12.4/bin/python -m venv /opt/venv-a0
33
-
34
-echo "====================PYENV END===================="
\ No newline at end of file
docker/base/fs/ins/install_python.sh
+43
-31
@@ -3,52 +3,64 @@ set -e
3
4
echo "====================PYTHON START===================="
5
6
-echo "====================PYTHON 3.12 & SID REPO===================="
6
+echo "====================PYTHON 3.13===================="
7
8
-apt clean
8
+apt clean && apt-get update && apt-get -y upgrade
9
+
10
+# install python 3.13 globally
11
+apt-get install -y --no-install-recommends \
12
+ python3.13 python3.13-venv
13
+ #python3.13-dev
14
10
-# ★ 1. Add sid repo & pin it for python 3.12
11
-# echo "deb http://deb.debian.org/debian sid main" > /etc/apt/sources.list.d/debian-sid.list
12
-# cat >/etc/apt/preferences.d/python312 <<'EOF'
13
-# Package: *
14
-# Pin: release a=sid
15
-# Pin-Priority: 100
15
17
-# Package: python3.12*
18
-# Pin: release a=sid
19
-# Pin-Priority: 990
16
+echo "====================PYTHON 3.13 VENV===================="
17
+
18
+# create and activate default venv
19
+python3.13 -m venv /opt/venv
20
+source /opt/venv/bin/activate
21
21
-# # Prevent Python 3.13 from being installed
22
-# Package: python3.13*
23
-# Pin: release *
24
-# Pin-Priority: -1
25
-# EOF
22
+# upgrade pip and install static packages
23
+pip install --no-cache-dir --upgrade pip ipython requests
24
27
-apt-get update && apt-get -y upgrade
25
+echo "====================PYTHON PYVENV===================="
26
27
+# Install pyenv build dependencies.
28
apt-get install -y --no-install-recommends \
30
- python3.13 python3.13-venv python3.13-dev
29
+ make build-essential libssl-dev zlib1g-dev libbz2-dev \
30
+ libreadline-dev libsqlite3-dev wget curl llvm \
31
+ libncursesw5-dev xz-utils tk-dev libxml2-dev \
32
+ libxmlsec1-dev libffi-dev liblzma-dev
33
32
-# ★ 3. Switch the interpreter
33
-# update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 0
34
-# update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
35
-# update-alternatives --set python3 /usr/bin/python3.12
34
+# Install pyenv globally
35
+git clone https://github.com/pyenv/pyenv.git /opt/pyenv
36
37
-echo "====================PYTHON VERSION: $(python3 --version) ===================="
38
-echo "====================PYTHON OTHERS: $(ls /usr/bin/python*) "
37
+# Setup environment variables for pyenv to be available system-wide
38
+cat > /etc/profile.d/pyenv.sh <<'EOF'
39
+export PYENV_ROOT="/opt/pyenv"
40
+export PATH="$PYENV_ROOT/bin:$PATH"
41
+eval "$(pyenv init --path)"
42
+EOF
43
40
-echo "====================PYTHON VENV===================="
44
+# fix permissions
45
+chmod +x /etc/profile.d/pyenv.sh
46
42
-# create and activate default venv
43
-python3.13 -m venv /opt/venv
44
-source /opt/venv/bin/activate
47
+# Source pyenv environment to make it available in this script
48
+source /etc/profile.d/pyenv.sh
49
+
50
+# Install Python 3.12.4
51
+echo "====================PYENV 3.12 VENV===================="
52
+pyenv install 3.12.4
53
+
54
+/opt/pyenv/versions/3.12.4/bin/python -m venv /opt/venv-a0
55
+source /opt/venv-a0/bin/activate
56
57
# upgrade pip and install static packages
47
-pip install --no-cache-dir --upgrade pip ipython requests
58
+pip install --no-cache-dir --upgrade pip
59
+
60
# Install some packages in specific variants
61
pip install --no-cache-dir \
50
- torch==2.6.0 \
51
- torchvision==0.21.0 \
62
+ torch==2.4.0 \
63
+ torchvision==0.19.0 \
64
--index-url https://download.pytorch.org/whl/cpu
65
66
echo "====================PYTHON UV ===================="