python - 使用 pyenv 安装特定的 python 版本
问题描述
我正在使用 MAC 进行开发工作并安装了 pyenv 来安装不同的 python 版本。我已经安装了 3.7,现在尝试使用 pyenv 安装 python 3.9.0。但它失败了。
下面是终端输出:
Mahbubs-MBP:~ rahman$ pyenv install 3.9.0
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.0.tar.xz...
-> https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz
Installing Python-3.9.0...
python-build: use readline from homebrew
BUILD FAILED (OS X 11.5.2 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/8p/v01dm57j2yv99fckz16cv5m00000gn/T/python-build.20210827122107.61252
Results logged to /var/folders/8p/v01dm57j2yv99fckz16cv5m00000gn/T/python-build.20210827122107.61252.log
Last 10 log lines:
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "darwin"
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/var/folders/8p/v01dm57j2yv99fckz16cv5m00000gn/T/python-build.20210827122107.61252/Python-3.9.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
我是否应该使用 brew 安装一些其他必需的软件包以使其工作?有什么建议吗?
解决方案
推荐阅读
- mysql - 根据 user_id 从 Deals_public 表中获取最新记录
- javascript - 如何扩展此 javascript/html 或正确编写它?
- windows - 作为 Windows Docker 桌面的一部分运行的 Kubernetes 集群是否有等效的 host.docker.internal
- database - Laravel:从数据库中检索模型
- laravel - 无法在 Laravel 中更新可翻译模型
- c# - 使用 c# 从 RTL-SDR 设备以 (.wav) 格式存储数据
- java - 我想在 Java 中循环,直到用户输入正确的值,但我做不到
- javascript - 使用 SSR 时未定义 Nuxt Store 的初始状态
- javascript - 创建帐户后 displayName 总是返回 null
- html - 如何影响所选卡的部分