suse12 安装python3.7.6

先安装gcc
zypper in gcc

下载python

tar -zxvf Python-3.7.6.tgz 
./configure --prefix=/usr/local/python3
make & make install

发现报下面的错误:

    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/home/liyi/download/python3install/Python-3.7.6/Lib/ensurepip/__init__.py", line 27, in _run_pip
    import pip._internal
zipimport.ZipImportError: can't decompress data; zlib not available
Makefile:1141: recipe for target 'install' failed
make: *** [install] Error 1
[1]+  Done                    make

下载zlib
http://www.zlib.net/
./configure
make & make install

还要装zlib-devel,直接zypper in zlib-devel

启动python

localhost:/usr/local/python3/bin # ./python3
Python 3.7.6 (default, Jan 22 2020, 10:33:58) 
[GCC 4.8.5] 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'
>>> 
posted @ 2020-01-22 10:39  clq.lib  阅读(2191)  评论(0)    收藏  举报