1、安裝Python-3.6.2.tgzpython
安裝依賴環境sql
最小化安裝Redhat6.4環境下ide
yum -y install gcc make zlib-devel bzip2-devel ncurses-devel readline-develui
(yum -y install gcc make zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel db4-devel gdbm-devel libpcap-devel xz-devel)sqlite
2.mkdir -p /usr/local/python3.6ip
3.編譯安裝ssl
tar -zxvf Python-3.6.2.tgzci
cd Python-3.6.2openssl
./configure --prefix=/usr/local/python3.6it
make
make install
4.設置python3.6爲默認python命令,並設置yum的配置
cd /usr/bin
mv python pythonold
vi yum
將#!/usr/bin/pythono改爲#!/usr/bin/pythonold
ln -s /usr/local/python3.6/bin/python3.6 python
2、安裝第三方庫
注:python3默認已經安裝,使用方法以下:
ln -s /usr/local/python3.6/bin/easy_install-3.6 /usr/bin/easy_install
ln -s /usr/local/python3.6/bin/pip3.6 /usr/bin/pip
pip install pyreadline
easy_install pyreadline
-----------------------------------
一、安裝setuptools-19.6.tar.gz
tar -zxvf setuptools-19.6.tar.gz
cd setuptools-19.6
python setup.py build
python setup.py install
二、安裝pip-8.0.2.tar.gz
tar -zxvf pip-8.0.2.tar.gz
cd pip-8.0.2
python setup.py build
python setup.py install