Skip to content

Instantly share code, notes, and snippets.

@bb1950328
bb1950328 / install_python_373_on_raspbian.md
Last active July 11, 2021 20:31
Install Python 3.7.3 on Raspbian

How to install Python 3.7 on Raspbian

Reqirements

Of course, you need a Raspberry Pi with a running Raspbian. I have tested this instructions on a Raspi 1 B+ and Raspbian Stretch (Image from 2019-04-08). I think, any newer hard/software will work too.

Compiling

Because there isn't any package for Python 3.7 on armhf (=Architecture of the Raspi), we have to compile Python from sources. This takes a while, but you can leave it completely unattended.

Downloading the sources

  1. Go to https://www.python.org/downloads/source/ and take the newest Release (at the time of writing, its 3.7.3).
  2. Download it with wget:
    wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
  3. Uncompress it with tar:\
@bb1950328
bb1950328 / cmakeFirstBuild.sh
Created December 28, 2021 17:40
CMake: create build dir, configure and build
#!/usr/bin/env bash
build_type_arg=${1:-release}
build_type_lower=${build_type_arg,,}
if ! [[ "$build_type_lower" =~ ^(debug|release|relwithdebinfo|minsizerel)$ ]]; then
echo "invalid build type specified"
exit 1;
fi
build_dir="cmake-build-${build_type_lower}"
@bb1950328
bb1950328 / build_python_version.py
Last active October 30, 2022 16:31
Download and build Python
#!/usr/bin/env python3
import os
import re
import sys
import time
import urllib.request
from collections import defaultdict
from pprint import pprint
from typing import Optional