Skip to content

Instantly share code, notes, and snippets.

@Akram-Hassan
Last active January 12, 2024 10:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Akram-Hassan/681beaf062224c1f7e35574c0debda17 to your computer and use it in GitHub Desktop.
Save Akram-Hassan/681beaf062224c1f7e35574c0debda17 to your computer and use it in GitHub Desktop.
Install Python 3.10 on CentOS 7

Installing Python 3.10.6 on CentOS 7 (7-2009)

Prerequisites:

yum -y groupinstall "Development Tools"
yum -y install gcc openssl-devel bzip2-devel libffi-devel

Add another repo for openssl11

yum install epel-release

Install openssl11

yum install openssl11
yum install openssl11-devel

Go to python source

wget https://www.python.org/ftp/python/3.10.6/Python-3.10.6.tar.xz
tar -xvf Python-3.10.6.tar.xz
cd Python-3.10.6

change python source to point to openssl11

sed -i 's/PKG_CONFIG openssl /PKG_CONFIG openssl11 /g' configure

compile and build Python (enable-shared is important for pyinstaller)

sudo ./configure --enable-optimizations --with-ensurepip=install --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"

make -j8

make altinstall
@vt107
Copy link

vt107 commented Jan 12, 2024

Worked on centos 7. I love it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment