Skip to content

Instantly share code, notes, and snippets.

@christian-korneck
Last active June 14, 2022 13:45
Show Gist options
  • Save christian-korneck/2b7c3c22ab1741597951c37f6470a6f4 to your computer and use it in GitHub Desktop.
Save christian-korneck/2b7c3c22ab1741597951c37f6470a6f4 to your computer and use it in GitHub Desktop.
install Python 3.7 on Fedora 36

build and install Python 3.7.13 from source on Fedora 36

dnf -y install gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel wget pkg-config
# optional:
# dnf -y groupinstall development-tools
cd /usr/src/
wget https://www.python.org/ftp/python/3.7.13/Python-3.7.13.tgz
tar xzf Python-3.7.13.tgz
cd Python-3.7.13/
./configure --prefix=/opt/python37 --enable-shared
make -j `nproc`
make install
echo 'export PATH=$PATH:/opt/python37/bin' > /etc/profile.d/python37path.sh
export PATH=$PATH:/opt/python37/bin
echo /opt/python37/lib > /etc/ld.so.conf.d/python37.conf
ldconfig
echo 'export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/python37/lib/pkgconfig' > /etc/profile.d/python37pkgconfig.sh
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/python37/lib/pkgconfig

# verify with
# python3.7 --version
# pkg-config --list-all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment