Step-by-Step Guide to Installing Python 3.10+ on CentOS 7
Objective: Install Python 3.10 or later on CentOS 7 while preserving the system-default Python 2.7 environment.
Step 1: Install Required Dependencies
1 |
|
Step 2: Download Python 3.10 Source Code
1 |
|
Step 3: Extract and Configure the Source Code
1 |
|
Configure the build with optimizations and a custom installation path:
1 |
|
./configure –enable-optimizations –prefix=/usr/local
Step 4: Compile and Install Python
1 |
|
Step 5: Verify Installation
1 |
|
Expected output: Python 3.10.0
Step 6: Create a python3 Soft Link (Optional)
If you want to use python3 as a shortcut for python3.10, follow these steps:
1. Check the Python 3.10 Installation Path
By default, Python 3.10 is installed to /usr/local/bin/python3.10. Verify this:
1
ls /usr/local/bin/python3.10
2. Create a Soft Link
1 |
|
3. Verify the Link
Check the new symlink and version:
1 |
|
Step-by-Step Guide to Installing Python 3.10+ on CentOS 7
https://gzthss.github.io/2025/05/10/Step-by-Step-Guide-to-Installing-Python-3-10-on-CentOS-7/