一、新建一个目录,用于存放Python文件
mkdir /usr/local/python
二、下载Python-3.6.1.tgz
三、上传
将下载完成的Python-3.6.1.tgz用CRT软件上传到Linux
CTR软件自行下载 : 网盘提取码:duca
四、解压
tar -zxvf Python-3.6.1.tgz
五、安装依赖包
yum install -y zlib zlib-devel.x86_64 yum install -y bzip2 bzip2-devel.x86_64 yum install -y ncurses ncurses-devel.x86_64 yum install -y readline readline-devel.x86_64 yum install -y openssl openssl-devel.x86_64 yum install -y openssl-static yum install -y xz lzma xz-devel.x86_64 yum install -y sqlite sqlite-devel.x86_64 yum install -y gdbm gdbm-devel.x86_64 yum install -y tk tk-devel.x86_64 yum install -y gcc.x86_64
六、安装Python
./configure make make install
七、编写一个小程序
vi text.py #!/usr/bin/python print('hello world')
八、输出
python text.py hello world