标签:tps https root 服务 localhost cap pen form down
在已经存在python2.7的环境添加python3.8
官网:https://www.python.org/downloads/
wget https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz
如果速度过慢,复制链接到迅雷,可以起飞。
然后将文件上传到服务器,拖拽即可,如果不行,安装文件上传服务。
yum install -y lrzsz
[root@localhost package]# tar zxf Python-3.8.2.tgz
[root@localhost package]# cd Python-3.8.2
3.1 安装前请确保有足够编译的库,报错贼难受 -.-
yum install zlib
yum install zlib-devel
yum install openssl
yum install openssl-devel
yum install readline-devel
yum install gcc patch libffi-devel python-devel bzip2-devel ncurses-devel sqlite-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel -y
3.2 配置
./configure --enable-optimizations --prefix=/usr/local/python-3.8.2
3.3 编译、安装
会耗时一会儿,莫慌
make
make install
成功后,配置目录下存在文件
[root@localhost bin]# cd /usr/local/python-3.8.2/
[root@localhost python-3.8.2]# pwd
/usr/local/python-3.8.2
[root@localhost python-3.8.2]# ls
bin include lib share
默认python命令是在/usr/bin/目录下,需要在这里新建一个软链接,链接到刚安装的python3.8.2目录。
[root@localhost bin]# ln -s /usr/local/python-3.8.2/bin/python3.8 /usr/bin/python3
[root@localhost bin]# python3
Python 3.8.2 (default, May 9 2020, 02:28:26)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
[root@localhost bin]#
再添加其他版本的Python同理,只要再不同名字的链接即可。
参考:
标签:tps https root 服务 localhost cap pen form down
原文地址:https://www.cnblogs.com/AganRun/p/12852560.html