【发布时间】:2018-12-04 20:07:12
【问题描述】:
我正在尝试在 macOS Mojave 10.14.2 Beta (18C52a) 上安装各种版本的 python3。
3.6.7 失败:
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-3.6.7.tar.xz...
-> https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tar.xz
Installing Python-3.6.7...
python-build: use readline from homebrew
BUILD FAILED (OS X 10.14.2 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/db/pjnyydt54kl3_snfwpvlsxf40000gp/T/python-build.20181204115752.83999
Results logged to /var/folders/db/pjnyydt54kl3_snfwpvlsxf40000gp/T/python-build.20181204115752.83999.log
Last 10 log lines:
./Include/pytime.h:200:52: warning: declaration of 'struct tm' will not be visible outside of this function [-Wvisibility]
PyAPI_FUNC(int) _PyTime_localtime(time_t t, struct tm *tm);
^
./Include/pytime.h:204:49: warning: declaration of 'struct tm' will not be visible outside of this function [-Wvisibility]
PyAPI_FUNC(int) _PyTime_gmtime(time_t t, struct tm *tm);
^
2 warnings generated.
2 warnings generated.
2 warnings generated.
2 warnings generated.
3.5.6 失败:
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-3.5.6.tar.xz...
-> https://www.python.org/ftp/python/3.5.6/Python-3.5.6.tar.xz
Installing Python-3.5.6...
python-build: use readline from homebrew
BUILD FAILED (OS X 10.14.2 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/db/pjnyydt54kl3_snfwpvlsxf40000gp/T/python-build.20181204115931.92145
Results logged to /var/folders/db/pjnyydt54kl3_snfwpvlsxf40000gp/T/python-build.20181204115931.92145.log
Last 10 log lines:
Python/pytime.c:508:13: warning: implicit declaration of function 'clock_getres' is invalid in C99 [-Wimplicit-function-declaration]
if (clock_getres(CLOCK_REALTIME, &res) == 0)
^
Python/pytime.c:508:13: warning: this function declaration is not a prototype [-Wstrict-prototypes]
Python/pytime.c:508:26: error: use of undeclared identifier 'CLOCK_REALTIME'
if (clock_getres(CLOCK_REALTIME, &res) == 0)
^
4 warnings and 2 errors generated.
make: *** [Python/pytime.o] Error 1
make: *** Waiting for unfinished jobs....
我试过了,通过brew:
- 重新安装所有
pyenv、python、python3、xz、readline、openssl(每个this answer) - 我已尝试安装和重新安装 macOS 开发者工具
- 我试过
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /(根据 pyenv 文档) - 我在运行
10.14.1 (18B75)的新版 Mojave 上进行了尝试,但遇到了同样的问题。
哦,该死的,我正在使用 Fish。我得看看这是不是鱼特有的问题??????
(更新:不,这不是 Fish,它发生在标准 /bin/sh 中)
【问题讨论】:
-
您是否尝试通过 Github 从源代码安装 pyenv 以查看是否可行? github.com/pyenv/pyenv#basic-github-checkout 。您还安装了最新版本的 gcc 和 xcode 吗?
-
没有尝试从源代码构建,我会试一试。还更好地仔细检查哪个 Xcode 版本处于活动状态...好电话。
-
别担心,让我知道,想看看结果如何 :)
-
不是您问题的具体解决方案;我在尝试安装 python 2 时遇到了同样的问题,我通过安装 miniconda2 版本来解决它。
-
能否请您发布完整的日志文件?
标签: python python-3.x macos macos-mojave pyenv