CentOS7 configuration Python3.7 development environment
1 2 3 4 5
|
wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
tar -zxvf Python-3.7.3.tgz
|
2. Installation tools
1 2 3 4 5 6 7 8
|
yum install -y gcc
yum -y groupinstall "Development tools"
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel libffi-devel
|
3. Compile install Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
mkdir / usr / local / python3
cd Python-3.7.3 /
--prefix = ./configure / usr / local / python3
make
the make the Test
install the make
|
Big Box CentOS configuration Python3 development environment tp: //qiniuyun.tiny777.com/blog/20190413/a1xLx9B0vC8x.png "alt =" mark ">
See this even if the installation was successful friends.
4. Create a soft link
1 2 3
|
ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
|
5. Modify the default version python and yum
Since this time the default python or before the built-in version 2.x, so we have to change it
1 2 3 4 5
|
rm / usr / bin / python
-s LN / usr / local /python3/bin/python3.7 / usr / bin / python
|
Since yum default is python2, this time certainly will not be able to modify the run, we need to yum configuration file also changed a bit
1 2
|
LL / usr / bin / | grep python
|
From the figure we can see that this computer is installed python2.7 and python3.7, pointing to the default python is 3.7.
1 2
|
Vim / usr / libexec / urlgrabber-EXT-Down
|
Finally input respectively yum
, python
, python2
, python3
, pip
and other commands check