File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ layout : post
3+ title : Compile and install python 3.13 on Ubuntu 20.04
4+ date : 2025-03-11 00:00:00
5+ categories : ubuntu python
6+ ---
7+
8+ While trying to compile and install python from source on Ubuntu 20.04, I kept hitting the following error on after running make:
9+
10+ ```
11+ Need to install the following packages:
12+
13+ __dbm __tkinter
14+ ```
15+
16+ To fix the issue, I had to install the following packages:
17+ ```
18+ sudo apt get update && sudo apt get install libgdbm-compat-dev tk-dev
19+ ```
20+
21+ To install python 3.13.2, the full set of commands become:
22+ ```
23+ sudo apt get update
24+
25+ sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev libbz2-dev libgdbm-compat-dev tk-dev wget
26+
27+ wget https://www.python.org/ftp/python/3.13.0/Python-3.13.2.tgz
28+
29+ tar -xvf Python-3.13.2.tgz
30+
31+ cd Python-3.13.2
32+
33+ ./configure --enable-optimizations
34+
35+ make -j 4
36+
37+ sudo make altinstall
38+
39+ python3.13 --version
40+ ```
41+
42+ Creating a virtual env from the new python install:
43+ ```
44+ python3.13 -m venv myvenv
45+
46+ source myvenv/bin/activate
47+ ```
You can’t perform that action at this time.
0 commit comments