1.使用命令下载软件包
安装依赖
yum -y install sqlite-devel
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
[root@VM_58_11_centos ~]#wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz 获取安装包
2.安装
[root@VM_58_11_centos ~]#tar -zxf Python-3.6.1.tgz 解压缩
[root@VM_58_11_centos ~]#cd Python-3.6.1 定位到文件夹#查看安装包文件[root@VM_58_11_centos Python-3.6.1]#ls
aclocal.m4 config.sub configure.ac Grammar install-sh LICENSE Makefile.pre.inModules Parser PCbuild Python setup.py
config.guess configure Doc Include Lib Mac Misc Objects PC pyconfig.h.inREADME Tools
[root@localhost Python-3.6.1]#./configure 添加配置
[root@localhost Python-3.6.1]#make 编译源码
[root@localhost Python-3.6.1]#make install 执行安装
执行完成后,进去看下版本就可以
[root@localhost utils]# python
Python 3.6.1 (default, Jun 8 2017, 19:01:21)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import sqlite3
>>>
注意:pip命令如果没法使用是因为python安装后生成的是pip3,不是pip可以做个连接解决