登陸官網找到Python3.6的下載地址python
右鍵複製下載地址c++
https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xzgit
下載及安裝[登陸linux服務器]github
# yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel [安裝依賴] # yum -y install sqlite-devel readline-devel tk-devel gdbm-devel [安裝依賴] # yum -y install db4-devel libpcap-devel xz-devel [安裝依賴] # yum -y install gcc gcc-c++ # cd /root/ # wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz [下載] # tar xf Python-3.6.2.tar.xz [解壓] # cd Python-3.6.2 # ./configure --prefix=/usr/local/python3.6 # make # make install
運行解釋器sql
# cd /usr/local/python3.6/bin/ # ./python3.6
如圖所示
ruby
使用PIp服務器
pip至關於Python的模塊管理工具,Python之因此強大緣由之一就是第三方庫的豐富 # cd /usr/local/python3.6/bin/ # ./pip3
配置環境變量curl
#ln -s /usr/local/python3.6/bin/python3 /usr/bin/python3 #ln -s /usr/local/python3.6/bin/pip3 /usr/bin/pip3
使用brew工具管理工具
brew 又叫Homebrew,是Mac OSX上的軟件包管理工具,能在Mac中方便的安裝軟件或者卸載軟件安裝brew
使用終端工具 # /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
使用brew安裝Python3.6
# 在終端輸入如下命令: # brew install python3 python安裝完成,具體路徑是:/usr/local/Cellar/python3/3.6.2/
運行解釋器
# cd /usr/local/Cellar/python3/3.6.2/bin/ # ./python3
登陸官網找到Python3.6的下載地址
點擊下載
安裝
進入解釋器
下載
選擇
安裝
過程省略