Ich versuche verschiedene Versionen von Python3 auf macOS Mojave 10.14.2 Beta (18C52a)
zu installieren.
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.
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....
Ich habe es durch brew
versucht:
pyenv
, python
, python3
, xz
, readline
, openssl
(pro dieser Antwort )Sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
ausprobiert (per pyenv docs)10.14.1 (18B75)
ausführt, und ich bekomme das gleiche Problem.Oh, und verdammt, ich benutze Fish. Ich werde nachsehen, ob es sich um ein Fischproblem handelt ???????? (Update: nein, es ist kein Fisch, es geschieht in einem Standard /bin/sh
)
Wenn Sie andere Versionen von Python beibehalten möchten, ist asdf eine gute Option. Sie können die folgenden Schritte zur Installation verwenden.
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.6.2
Und da Sie Fisch zu verwenden scheinen, können Sie Folgendes tun
echo 'source ~/.asdf/asdf.fish' >> ~/.config/fish/config.fish
mkdir -p ~/.config/fish/completions; and cp ~/.asdf/completions/asdf.fish ~/.config/fish/completions
An diesem Punkt möchten Sie Ihr Terminal neu starten, damit asdf wirksam wird. Bei einem Mac-Betriebssystem müssen Sie möglicherweise coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc
homebrew installieren, da einige Plugins sie benötigen.
Danach können Sie das Python-Plugin installieren. Zuerst muss es gezogen werden.
asdf plugin-add python
Sobald Sie das Plugin installiert haben, können Sie die benötigten Versionen installieren.
asdf install python 3.5.6
asdf install python 3.6.7
Sobald sie erfolgreich installiert wurden, können Sie mit zwischen wechseln
asdf global python <version-of-your-choice: eg. 3.5.6>
z.B. asdf global python 3.5.6
Ich hoffe das hilft.