Correct way to install Python 3.12 on Ubuntu 24.04 (with pip & venv)?
Install python 3.13 on noble 24
Help with installing Python packages on Ubuntu 24.04.
When can we expect Python 3.10 in Anaconda?
It was added to the conda-forge channel 7 hours ago. You can install it with
conda install -c conda-forge python=3.10More on reddit.com
Videos
What’s the right way to install Python 3.12 on Ubuntu 24.04, with pip and venv working out of the box?
I tried:
sudo apt install python3.12.3
But it didn’t include pip or venv, and I hit an “externally managed environment” error when using pip in a venv.
Should I be using:
sudo apt install python3-full
or:
sudo apt-get install python3 python3-dev instead?
Just looking for the cleanest, correct way to get a working Python dev setup on this version of Ubuntu — any clarification appreciated.
To install Python 3.8 on Ubuntu version 23
Open your terminal and run these commands:
Install build dependencies
sudo apt-get update
sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm \
libncurses5-dev libncursesw5-dev xz-utils tk-dev \
libffi-dev liblzma-dev python3-openssl git
Download and extract Python 3.8 source code
mkdir ~/python38
cd ~/python38
wget https://www.python.org/ftp/python/3.8.16/Python-3.8.16.tgz
tar -xf Python-3.8.16.tgz
cd Python-3.8.16
Configure the build
./configure --enable-optimizations
Compile the source code
make -j$(nproc)
Install Python
sudo make install
Verify the installation
python3.8 --version
To create a virtual environment specify the Python version.
Example:
python3.8 -m venv venv
Assuming you need this simply for development reasons, there's no reason to install it, but rather build it only.
Follow the steps from @GODFREY but skip the install altogether - which most probably will screw up your system.
After make -j$(nproc) you get a python binary in the directory which you can test
./python --version
# => Python 3.10.14
Now in your python project you can use virtualenv directly to use the binary
# Assuming the source is in ~/Python-3.10.14
virtualenv -p ~/Python-3.10.14/python .venv
source .venv/bin/activate
python --version
# => Python 3.10.14