sudo port install python39 py39-pip py39-setuptools py39-setuptools py39-psycopg2 openssl freetype
# sudo port install py39-numpy # (OR) brew install openblas
sudo port select--set python3 python39
sudo port select--set pip3 pip39
# Instructions For Variables# https://stackoverflow.com/a/65072442/6828099# https://stackoverflow.com/a/60748789/6828099export PATH=/opt/local/lib/postgresql13/bin/:$PATHexport LDFLAGS="-L/opt/local/lib"export CPPFLAGS="-I/opt/local/include"# You may need to specify --no-cache-dir after install
pip3 install -r requirements.txt
For HomeBrew
# These instructions assume using a venv
brew install mysql postgresql python3
export PATH=/usr/local/Cellar/postgresql/13.2_1/bin:$PATH# You may need to specify --no-cache-dir after install
pip3 install -r requirements.txt
RPi
# Install Python 3.9cd /usr/src
# Download and Extract Python 3.9
sudo wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz
sudo tar xvf Python-3.9.1.tgz
# Install Build Tools
sudo apt-get update
sudo apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev
# Build Python 3.9cd Python-3.9.1
sudo ./configure --enable-optimizations
sudo make altinstall
# Symlink Python (You May Need To Add /usr/local/bin/ To Your Executable Path)
sudo ln -s /usr/local/bin/python3.9 /usr/local/bin/python
sudo ln -s /usr/local/bin/python3.9 /usr/local/bin/python3
# OPTIONAL (Disable Built In Python)
sudo chmod -x /usr/bin/python
sudo chmod -x /usr/bin/python3
# Install Pip, Wheel, and SetupTools
python3 -m pip install --upgrade pip setuptools wheel
# Install postgres-dev For psycopg2
sudo apt-get install libpq-dev
# You may need to specify --no-cache-dir after install
pip3 install -r requirements.txt
Deprecated RPI Instructions (Due To 3.7 Being The Latest Release and Requirement For 3.9+)
# Install Missing Libraries
sudo apt-get install libfreetype6-dev libopenjp2-7 libtiff5
# You may need to specify --no-cache-dir after install
pip3 install -r requirements.txt
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.