Ubuntu/Python/3.14: Difference between revisions

From Omnia
< Ubuntu‎ | Python
Jump to navigation Jump to search
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Install with DeadSnakes PPA ==
Dependency:
Dependency:
  sudo apt install software-properties-common
  sudo apt install software-properties-common
Line 4: Line 6:
Add Deadsnakes and install python 3.14
Add Deadsnakes and install python 3.14
  sudo add-apt-repository ppa:deadsnakes/ppa
  sudo add-apt-repository ppa:deadsnakes/ppa
  # respond to prompts
  sudo apt update
  sudo apt update
  sudo apt install python3.14
  sudo apt install python3.14
# should also install:
sudo apt install python3.14-dev python3.14-venv


  python3.14 --version
  python3.14 --version
Line 33: Line 38:


  cd ~ ; rm -rf .test-venv ; mkdir .test-venv ; cd .test-venv ; python3.14 -m venv 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
<pre>
#!/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())
</pre>
Alternatively, you could also just create an alias:
alias pip3.14="python3.14 -m pip"
== keywords ==

Latest revision as of 20:06, 27 April 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
# should also install:
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:

curl -sS https://bootstrap.pypa.io/get-pip.py | python3.14
python3.14 -m pip install pip --upgrade
python3.14 -m pip --version
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