gpt4 book ai didi

xcode - MacOS 上的 pyenv zlib 错误 :

转载 作者:行者123 更新时间:2023-12-03 07:52:35 29 4
gpt4 key购买 nike

我的目标

我正在尝试使用 pyenv 在我的 MBP 上并排安装 Python 2.7.5 和 3.6.5。
pyenv安装

关注 How can I use Homebrew to install both Python 2 and 3 on Mac? , 我试过:

$ pyenv install 3.6.5

哪个错误:
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-3.6.5.tar.xz...
-> https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
Installing Python-3.6.5...
python-build: use readline from homebrew

BUILD FAILED (OS X 10.13.4 using python-build 20160602)

Inspect or clean up the working tree at /var/folders/d0/t8d3jjp161g2dyrd4k67ypc80000gn/T/python-build.20180426091253.34709
Results logged to /var/folders/d0/t8d3jjp161g2dyrd4k67ypc80000gn/T/python-build.20180426091253.34709.log

Last 10 log lines:
File "/private/var/folders/d0/t8d3jjp161g2dyrd4k67ypc80000gn/T/python-build.20180426091253.34709/Python-3.6.5/Lib/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
File "/private/var/folders/d0/t8d3jjp161g2dyrd4k67ypc80000gn/T/python-build.20180426091253.34709/Python-3.6.5/Lib/ensurepip/__init__.py", line 204, in _main
default_pip=args.default_pip,
File "/private/var/folders/d0/t8d3jjp161g2dyrd4k67ypc80000gn/T/python-build.20180426091253.34709/Python-3.6.5/Lib/ensurepip/__init__.py", line 117, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/private/var/folders/d0/t8d3jjp161g2dyrd4k67ypc80000gn/T/python-build.20180426091253.34709/Python-3.6.5/Lib/ensurepip/__init__.py", line 27, in _run_pip
import pip
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1

我试过什么
  • 安装 zlib:brew install zlib

  • 我的问题

    如何使用 pyenv 安装多个 Python 环境在 MBP 上?

    最佳答案

    在 Mojave 上,安装 Xcode 命令行工具后,必须运行以下命令:

    sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

    关于xcode - MacOS 上的 pyenv zlib 错误 :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50036091/

    29 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com