当前位置: 首页 > 工具软件 > ruby-build > 使用案例 >

ubuntu16.06用pyenv安装python时出现BUILD FAILED (Ubuntu 16.04 using python-build 20180424)问题

韦知
2023-12-01

ubuntu16.06用pyenv安装python时出现BUILD FAILED (Ubuntu 16.04 using python-build 20180424)问题

问题:
ubuntu16.04安装好pyenv后输入:

pyenv install 3.6.1

出现:

kr@kr:~$ pyenv install 3.6.1

Downloading Python-3.6.1.tar.xz...
-> https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
Installing Python-3.6.1...

BUILD FAILED (Ubuntu 16.04 using python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20170621142635.19271
Results logged to /tmp/python-build.20170621142635.19271.log

Last 10 log lines:
    ensurepip._main()
  File "/tmp/python-build.20170621142635.19271/Python-3.6.1/Lib/ensurepip/__init__.py", line 189, in _main
    default_pip=args.default_pip,
  File "/tmp/python-build.20170621142635.19271/Python-3.6.1/Lib/ensurepip/__init__.py", line 102, in bootstrap
    _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/tmp/python-build.20170621142635.19271/Python-3.6.1/Lib/ensurepip/__init__.py", line 27, in _run_pip
    import pip
zipimport.ZipImportError: can't decompress data; zlib not available
Makefile:1064: recipe for target 'install' failed
make: *** [install] Error 1

解决:
首先安装zlib1g

sudo apt-get install zlib1g-dev
kr@kr:~$ pyenv install 3.6.4
Downloading Python-3.6.4.tar.xz...
-> https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz
Installing Python-3.6.4...
WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems


BUILD FAILED (Ubuntu 16.04 using python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20191228093546.16997
Results logged to /tmp/python-build.20191228093546.16997.log

Last 10 log lines:
		upgrade) ensurepip="--upgrade" ;; \
		install|*) ensurepip="" ;; \
	esac; \
	 ./python -E -m ensurepip \
		$ensurepip --root=/ ; \
fi
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-9.0.1 setuptools-28.8.0

然后安装libssl

sudo apt-get install libssl-dev

最后安装python即可

pyenv install 3.6.4
 类似资料: