python×××鏈接:https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
創(chuàng)新互聯(lián)是一家專注于成都網(wǎng)站建設(shè)、成都網(wǎng)站制作與策劃設(shè)計(jì),中陽(yáng)網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)十多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:中陽(yáng)等地區(qū)。中陽(yáng)做網(wǎng)站價(jià)格咨詢:18980820575
上傳至服務(wù)器:/usr/local/src
tar zxf Python-3.6.3.tgz -C /usr/local/src/
安裝依賴:
yum groupinstall "Development tools"
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
源碼安裝python包
./configure --prefix=/usr/local/python36/ --enable-optimizations
make && make install
編譯時(shí)長(zhǎng)與硬件性能有關(guān)
報(bào)錯(cuò)解決:
在執(zhí)行make install
ModuleNotFoundError: No module named '_ctypes'
解決依賴:
依賴下載:
wget http://mirror.yandex.ru/fedora/russianfedora/russianfedora/fixes/el/releases/6/Everything/x86_64/os//xulrunner10-10.0.1-2.el6.R.x86_64.rpm
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/nss-softokn-freebl-3.14.3-23.3.el6_8.x86_64.rpm
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/glibc-2.12-1.212.el6.i686.rpm
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/libffi-3.0.5-3.2.el6.i686.rpm
wget http://mirror.centos.org/centos/6/os/i386/Packages/libffi-devel-3.0.5-3.2.el6.i686.rpm
yum install libffi-devel -y
修改yum包
vim /usr/bin/yum
#!/usr/bin/python 改為 #!/usr/bin/python2.6
修改: /usr/libexec/urlgrabber-ext-down
#! /usr/bin/python2
設(shè)置默認(rèn)python為python3.6
ln -s /usr/local/python36/bin/python3 /usr/bin/python
檢查版本
#python -V
Python 3.6.3
pypi官方包下載目錄
https://pypi.org/
下載什么直接搜索就好了,直接下載即可
安裝使用pip install package-name.whl
安裝過(guò)程中出現(xiàn)各種依賴,對(duì)于離線安裝的用戶可根據(jù)提示在pypi官網(wǎng)請(qǐng)?zhí)砑渔溄用枋鲞M(jìn)行查找相關(guān)依賴的包安裝即可。
安裝ipthon
下載ipython項(xiàng)目包
https://codeload.github.com/ipython/ipython/zip/master
unzip ipython-master.zip && cd ipython-master
對(duì)于源碼安裝直接運(yùn)行
python setup.py install
測(cè)試