bra*_*ipt 6 python macos python-3.x pyenv macos-mojave
我正在尝试在macOS Mojave上安装各种版本的python3 10.14.2 Beta (18C52a).
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.
Run Code Online (Sandbox Code Playgroud)
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....
Run Code Online (Sandbox Code Playgroud)
我试过,通过brew:
pyenv,python,python3,xz,readline,openssl(每此答案)sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /(根据pyenv文档)10.14.1 (18B75),我遇到了同样的问题.哦,而且,我正在使用Fish.我将不得不查看这是否是鱼类特定的问题(更新:不,它不是鱼,它发生在标准中/bin/sh)
小智 0
如果您想要维护不同版本的 python,asdf是一个不错的选择。您可以使用以下步骤进行安装。
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.6.2
Run Code Online (Sandbox Code Playgroud)
由于您似乎使用鱼,您可以执行以下操作
echo 'source ~/.asdf/asdf.fish' >> ~/.config/fish/config.fish
mkdir -p ~/.config/fish/completions; and cp ~/.asdf/completions/asdf.fish ~/.config/fish/completions
Run Code Online (Sandbox Code Playgroud)
此时,您需要重新启动终端以使 asdf 生效。您可能需要自制安装一台 mac 操作系统coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc,因为某些插件可能需要它们。
然后你现在就可以安装 python 插件了。首先需要拉它。
asdf plugin-add python
Run Code Online (Sandbox Code Playgroud)
安装插件后,就可以安装所需的版本了。
asdf install python 3.5.6
asdf install python 3.6.7
Run Code Online (Sandbox Code Playgroud)
成功安装后,您可以使用以下命令在它们之间切换
asdf global python <version-of-your-choice: eg. 3.5.6>
Run Code Online (Sandbox Code Playgroud)
例如。asdf 全局 python 3.5.6
我希望这有帮助。
| 归档时间: |
|
| 查看次数: |
520 次 |
| 最近记录: |