-
Notifications
You must be signed in to change notification settings - Fork 0
/
Installing_Python_3.8_on_centos
90 lines (83 loc) · 2.09 KB
/
Installing_Python_3.8_on_centos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Install Python 3.8 on CentOS 6 from source
Posted on July 18, 2020 by ServerOk
To install Python 3.8 on CentOS, you need to install OpenSSL as the one installed by CentOS from yum is very old.
cd /usr/local/src
wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
tar xvf openssl-1.1.1g.tar.gz
cd openssl-1.1.1g
./config --prefix=/usr/serverok/openssl --openssldir=/usr/serverok/openssl no-ssl2
make
make install
1
2
3
4
5
6
7
cd /usr/local/src
wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
tar xvf openssl-1.1.1g.tar.gz
cd openssl-1.1.1g
./config --prefix=/usr/serverok/openssl --openssldir=/usr/serverok/openssl no-ssl2
make
make install
Now edit file
vi ~/.bash_profile
1
vi ~/.bash_profile
at end of the file, add
export PATH=/usr/serverok/openssl/bin:$PATH
export LD_LIBRARY_PATH=/usr/serverok/openssl/lib
export LC_ALL="en_US.UTF-8"
export LDFLAGS="-L/usr/serverok/openssl/lib -Wl,-rpath,/usr/serverok/openssl/lib"
1
2
3
4
export PATH=/usr/serverok/openssl/bin:$PATH
export LD_LIBRARY_PATH=/usr/serverok/openssl/lib
export LC_ALL="en_US.UTF-8"
export LDFLAGS="-L/usr/serverok/openssl/lib -Wl,-rpath,/usr/serverok/openssl/lib"
Make the settings active with command
source ~/.bash_profile
1
source ~/.bash_profile
Now we can install Python 3.8 with
cd /usr/local/src
wget https://www.python.org/ftp/python/3.8.4/Python-3.8.4.tar.xz
tar xvf Python-3.8.4.tar.xz
cd /usr/local/src/Python-3.8.4
make clean && make distclean
./configure --enable-optimizations --with-openssl=/usr/serverok/openssl/
make altinstall
1
2
3
4
5
6
7
cd /usr/local/src
wget https://www.python.org/ftp/python/3.8.4/Python-3.8.4.tar.xz
tar xvf Python-3.8.4.tar.xz
cd /usr/local/src/Python-3.8.4
make clean && make distclean
./configure --enable-optimizations --with-openssl=/usr/serverok/openssl/
make altinstall
Now python 3.8 will be available in your system under /usr/local/bin
root@server12:~# python3.8 --version
Python 3.8.4
root@server12:~# which python3.8
/usr/local/bin/python3.8
root@server12:~#
1
2
3
4
5
root@server12:~# python3.8 --version
Python 3.8.4
root@server12:~# which python3.8
/usr/local/bin/python3.8
root@server12:~#