Ubuntu/Python/3.14: Difference between revisions

From Omnia
< Ubuntu‎ | Python
Jump to navigation Jump to search
Line 8: Line 8:
   # respond to prompts
   # respond to prompts
  sudo apt update
  sudo apt update
  sudo apt install python3.14
 
  # should also install:
  # sudo apt install python3.14
  ## BETTER, should also install virtual-env
  sudo apt install python3.14-dev python3.14-venv
  sudo apt install python3.14-dev python3.14-venv


Line 20: Line 21:
  sudo apt install python3.14-full
  sudo apt install python3.14-full


Pip:
Pip 3.14:
 
# First, try and see if pip responds
sudo python3.14 -m pip --version
 
If Pip was previously installed, but is sad:
 
sudo apt remove python3-pip
 
## OR try force upgrading it
 
sudo python3.14 -m pip install --upgrade --ignore-installed pip
 
If Pip was not previously installed:
 
## not needed
# mkdir ~/.src ; cd ~/.src
# mkdir pip3.14 ; cd pip3.14
 
curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python3.14
# or user only:
  curl -sS https://bootstrap.pypa.io/get-pip.py | python3.14
  curl -sS https://bootstrap.pypa.io/get-pip.py | python3.14


Verify:
sudo python3.14 -m pip --version
python3.14 -m pip --version
sudo pip3.14 --version
pip3.14 --version
sudo which pip3.14
which pip3.14
Upgrade:
sudo python3.14 -m pip install pip --upgrade
# or
  python3.14 -m pip install pip --upgrade
  python3.14 -m pip install pip --upgrade


sudo python3.14 -m pip --version
  python3.14 -m pip --version
  python3.14 -m pip --version


List
  python3.14 -m pip list
  python3.14 -m pip list



Revision as of 22:17, 2 August 2026

Install with DeadSnakes PPA

Dependency:

sudo apt install software-properties-common

Add Deadsnakes and install python 3.14

sudo add-apt-repository ppa:deadsnakes/ppa
  # respond to prompts
sudo apt update
# sudo apt install python3.14
## BETTER, should also install virtual-env
sudo apt install python3.14-dev python3.14-venv
python3.14 --version

For development, virtuan env

sudo apt install python3.14-dev python3.14-venv

For a more complete installation including the Tkinter IDE and other utilities, you can use:

sudo apt install python3.14-full

Pip 3.14:

# First, try and see if pip responds
sudo python3.14 -m pip --version

If Pip was previously installed, but is sad:

sudo apt remove python3-pip
## OR try force upgrading it
sudo python3.14 -m pip install --upgrade --ignore-installed pip

If Pip was not previously installed:

## not needed
# mkdir ~/.src ; cd ~/.src
# mkdir pip3.14 ; cd pip3.14
curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python3.14
# or user only:
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.14

Verify:

sudo python3.14 -m pip --version
python3.14 -m pip --version
sudo pip3.14 --version
pip3.14 --version
sudo which pip3.14
which pip3.14

Upgrade:

sudo python3.14 -m pip install pip --upgrade
# or
python3.14 -m pip install pip --upgrade
sudo python3.14 -m pip --version
python3.14 -m pip --version

List

python3.14 -m pip list

venv: (requires pip)

python3.14 -m venv -h
# check if pip is working
python3.14 -m ensurepip
  #   /usr/bin/python3.14: No module named ensurepip
  # if this fails with the above, install pip and python3.14-venv ^
cd ~ ; rm -rf .test-venv ; mkdir .test-venv ; cd .test-venv ; python3.14 -m venv venv

pip3.14 script

Dead-Snakes doesn't install the pip3.14 script for reasons (as you will see...) You can manually install, by copying the python 3.12 version, and changing the shebang header from python3 to python3.14. Only useful as a convenience for regular users, not for root.

cd /usr/bin
cp pip3.12 pip3.14
sed -i "s/python3/python3.14/" pip3.14

Note, calling pip directly as root will error out, but at least as users you can call it to install local packages

pip3.14 install pip --upgrade
 ERROR: Cannot uninstall pip 24.0, RECORD file not found. Hint: The package was installed by debian.

/usr/bin/pip3.14

#!/usr/bin/python3.14
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == "__main__":
    sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
    sys.exit(main())


Alternatively, you could also just create an alias:

alias pip3.14="python3.14 -m pip"

keywords