Skip to content

Commit 17d5fcb

Browse files
committed
Add new post for March 2025
1 parent cc0d539 commit 17d5fcb

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
```

0 commit comments

Comments
 (0)