您好,登錄后才能下訂單哦!
python×××鏈接:https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
上傳至服務器:/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
編譯時長與硬件性能有關
報錯解決:
在執行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
設置默認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
安裝過程中出現各種依賴,對于離線安裝的用戶可根據提示在pypi官網請添加鏈接描述進行查找相關依賴的包安裝即可。
安裝ipthon
下載ipython項目包
https://codeload.github.com/ipython/ipython/zip/master
unzip ipython-master.zip && cd ipython-master
對于源碼安裝直接運行
python setup.py install
測試
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。