25 nov 2025

kubuntu 25.10 python 3.12

problem
 25.10 comes with python3.13 system-wide. If we need 3.12 e.g. for setiastrosuitepro...

dual-boot Pop!_OS 24.04 - Kubuntu 25.10
On Pop and Ubuntu 24.04 you're already good

what it does 

It installs python3.12 but leaving the system python untouched. As the install default is /usr/local, the PATH is automatically taken care of.
Inspiration from here

method

update
sudo apt update && sudo apt upgrade -y

install requirements
sudo apt install -y software-properties-common build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev  libreadline-dev libffi-dev curl libsqlite3-dev wget llvm libbz2-dev tk-dev linux-headers-$(uname -r)

build and install

mkdir -p ~/py3.12
cd py3.12
wget https://www.python.org/ftp/python/3.12.12/Python-3.12.12.tgz
tar -xf Python-3.12.12.tgz
cd Python-3.12.12

./configure --enable-optimizations
make -j$(nproc)
sudo make altinstall


notes
we use altinstall to retain the system installed python3

check
python3.12 --version
Python 3.12.12

which python3.12
/usr/local/bin/python3.12

python3 --version
Python 3.13.7

which python3
/usr/bin/python3

Lastly, pyinstaller DON'T FORGET:
So that pyinstaller can find the libraries, activate the venv, then, before calling pyinstaller:

sudo ldconfig /usr/local/lib

No hay comentarios:

Publicar un comentario