一.先更換系統源python
爲了下載順暢通常都會更改成國內源。linux
1 cd /etc/yum.repos.d/ 2 wget http://mirrors.163.com/.help/CentOS6-Base-163.repo #下載網易源 3 mv CentOS-Base.repo CentOS-Base.repo.ori #備份源 4 mv CentOS6-Base-163.repo CentOS-Base.repo #把網易源更改成默認源
二.安裝依賴包sql
1 yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel
三.下載python3.6.1並安裝centos
下載python天然而然要去python官網下載,目前python3.6.1是最新版的。code
點擊以下載頁面:我選擇的是紅色框中的,右擊複製連接地址。orm
而後開始下載、編譯、安裝python3.6sqlite
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz tar vxf Python-3.6.1.tgz cd Python-3.6.1.tgz ./configure --prefix=/usr/local #編譯,自定義安裝目錄,若是自定目錄不在環境變量重要,要把安裝的目錄加入到環境變量中 make && make install #這個過程會很是慢
ln –s /usr/local/bin/python3 /usr/bin/python3 #創建軟鏈接
檢查是否安裝成功blog
[root@centos6 bin]# python3 Python 3.6.1 (default, May 12 2017, 00:21:59) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux Type "help", "copyright", "credits" or "license" for more information.
四.安裝pip(pip-9.0)ip
wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9 #pip下載,官網去下載。 tar zxf pip-9.0.1.tar.gz cd pip-9.0.1 python3 setup.py install
五.安裝ipythonmd5
pip安裝成功以後,安裝ipython就很容易了
pip install ipython