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进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。