Last active
October 30, 2024 17:01
-
-
Save wpupru/deda1cd96ea242d9a790e50cd0c97e9f to your computer and use it in GitHub Desktop.
Install Python 3.7.0 on Centos 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install Python 3.7.0 on CentOS/RHEL 7 | |
1.Requirements: | |
yum install gcc openssl-devel bzip2-devel | |
2.Download Python 3.7: | |
cd /usr/src | |
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz | |
tar xzf Python-3.7.0.tgz | |
3.Install Python 3.7.0: | |
cd Python-3.7.0 | |
./configure --enable-optimizations | |
make altinstall | |
(make altinstall is used to prevent replacing the default python binary file /usr/bin/python) | |
4.Remove downloaded source archive file from your system: | |
rm /usr/src/Python-3.7.0.tgz | |
5.Check Python Version | |
python3.7 -V | |
echo 'alias python3.7="python3"' >> ~/.bashrc | |
********************************************************************** | |
Команды Python: | |
django-admin startproject firstproject // создание нового проекта | |
django-admin -h // посмотреть все команды | |
#Создание нового приложения: | |
python manage.py startapp firstapp | |
You will need :
sudo yum install libffi-devel
That works perfectly AlmaLinux release 8.5
Here's my one-liner (well, a 3-liner) for installing Python 3.7 on CentOS7
sudo su
yum install -y wget gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel ; cd /usr/src; wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz ; tar xzf Python-3.7.0.tgz ; cd Python-3.7.0 ; ./configure --enable-optimizations ; make altinstall ; rm -rf /usr/bin/python3 ; ln -s /usr/local/bin/python3.7 /usr/bin/python3 ; python3 -V
uname -a
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Had same issue on Centos 7, it can be fixed by install some packages such as libffi-devel. If it does not work maybe try install the following:
yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel
After installing these packages, you have to reinstall the version of python. It went well in my case. Hope it helps