pyenv安装3.6.3错误发生:为什么?

时间:2017-10-19 15:54:38

标签: pyenv

user@syyun:~$ pyenv install 3.6.3
Downloading Python-3.6.3.tar.xz...
-> https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz
Installing Python-3.6.3...

BUILD FAILED (Ubuntu 16.04 using python-build 1.1.5-8-g7b9d1a4)
Inspect or clean up the working tree at /tmp/python-build.20171020004725.32507
Results logged to /tmp/python-build.20171020004725.32507.log

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

无法在pyenv install命令中找到上述给定错误的相关google搜索记录。

任何指导都将不胜感激

1 个答案:

答案 0 :(得分:2)

pyenv wiki回答了这个问题。在尝试使用pyenv构建Python解释器之前,必须首先准备构建环境。

根据wiki,您需要为Ubuntu安装以下软件包:

apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev