suse11 sp4自带zlib-1.2.7但是make & make install时提示你找不到zlib.h
所以安装zlib-1.2.8即可
tar -xvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make & make install
第二步:安装python3.6.5
进入到下载后的python文件目录下
./configure --prefix=/usr/local/python3
make & make install
(备注:--prefix=/usr/local/python/python3.6.5 指的是安装后的路径,自己随便指向)
第三步:创建指向(这样做可以在不破化系统使用的到的python2.6.9)
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
测试:
cd /usr/bin/
python3
==运行结果==
Python 3.6.5 (default, Apr 3 2018, 11:25:01)
[GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/etc/pythonstart", line 7, in <module>
import readline
ModuleNotFoundError: No module named 'readline'
>>> print("helo");
helo
>>> exit();
第五步:安装时,提示 python INFO: Can‘t locate Tcl/Tk libs and/or headers
需要安装
tk-8.5.5-3.2.src.rpm
tcl-8.5.5-2.7.src.rpm
tcl-devel-8.5.5-2.7.x86_64.rpm
tk-devel-8.5.5-3.2.x86_64.rpm(以下为它的依赖包)
xorg-x11-libX11-devel-7.4-5.2.x86_64.rpmxorg-x11-libxcb-devel-7.4-1.3.x86_64.rpm
xorg-x11-libXau-devel-7.4-1.3.x86_64.rpm
xorg-x11-proto-devel-7.6-116.1.x86_64.rpm
xorg-x11-xtrans-devel-7.5-2.2.x86_64.rpm
这个网站可以下载以上包 http://rpm.pbone.net/