LoginSignup
0
0

More than 1 year has passed since last update.

自分のMacBook Airに最新のPythonを入れようとした

Last updated at Posted at 2022-09-20

アイトラッキングがしたかった

が、あろうことか最新の方のPythonが入ってなかったぽいのでインストールしようとした時のメモ。
https://prog-8.com/docs/python-envに従ってやれば普通は問題なさそうだが、いくつかエラーが出て詰まったので記録として。ただちょっと前の話なので記憶が曖昧で、エラー出たのは覚えてるんだけど順序がわからねえので順不同で全部書いときます。
こういう個人ブログとかにたくさん助けられてきてるので、拙いながらも助けになれないかなあと思い執筆しております。

エラー1個目

こんなエラーが出た。

Fatal: You must get working getaddrinfo() function.
        or you can specify "--disable-ipv6".

本当は前後にもうちょい書いてあった気がするけど、忘れた。
このサイトにあった通り、sudo xcode-select --installやったらいけた。(sudoってなんか怖いイメージある。なんでもできちゃいそうだから。)

エラー2個目

pyenvでpythonインストールしようとしたら、BUILD FAILEDのエラーが出た。(以下参考サイトのコピペ)

$ pyenv install 3.10.3
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.10.3.tar.xz...
-> https://www.python.org/ftp/python/3.10.3/Python-3.10.3.tar.xz
Installing Python-3.10.3...
python-build: use tcl-tk from homebrew
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

BUILD FAILED (OS X 11.6.5 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/[redacted]
Results logged to /var/folders/[redacted]/python-build.20220324161857.15677.log

Last 10 log lines:
checking for crypt_r... no
checking for clock_gettime... yes
checking for clock_getres... yes
checking for clock_settime... yes
checking for major... yes
checking for getaddrinfo... yes
checking getaddrinfo bug... yes
Fatal: You must get working getaddrinfo() function.
       or you can specify "--disable-ipv6".
make: *** No targets specified and no makefile found.  Stop.

そこで調べたら色々出てきたものの、自信のMacで見覚えのあるTrend Microの名前が見えたので、このサイトに行き着き、

$ while true; do sleep 1; ps ax | grep iCoreService | grep /libTmAntiMalware.dylib | awk '{ print $1}' | xargs sudo kill -9; done

これを実行しながらインストールでいけた。(マジでコード書いてくれてたのありがたい)原因はTrend Micro Security のApex Oneだったっぽいね。

エラー3個目

今度はXcodeから「コマンドライン・デベロッパツールが必要です。ツールを今すぐインストールしますか?」みたいなポップアップが出てきた。
それでインストして再実行するも同じことの繰り返し。ターミナルの方ではエラーも出てて、なんかgccが無いよとかclangが無いよみたいなことを言ってた気がする。(忘れた)

とりまgccとかは前で来た覚えがあるので、無いってなんやねんと思って実行したら(以下、一部抜粋)

Xcode Metal Compiler error: 2022-09-14 13:46:53.395 xcodebuild[7514:147834] [MT]
DVTPlugInLoading: Failed to load code for plug-in com.apple.dt.IDESimulatorAvailability
(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin), error = Error Domain=NSCocoaErrorDomain Code=3588
"dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (OBJC_CLASS$_SimDiskImage)

このサイトと同じエラーが出てきて、はあ??と思ったのも束の間。よくみたら、

Please ensure Xcode packages are up-to-date — try running xcodebuild -runFirstLaunch

って書いてあったので、大人しくxcodebuild -runFirstLaunchを実行したらいけた。
原因はXcodeのなんかが起動してなかったということなんかな。Xcode入れたけど全然使ってないんだよなあ。

メモ終わり

とまあそんなわけでめでたくpythonが入りましたとさ。アイトラッキングがやりたかったのでパパッとできるかなと思ってたらよもやpython入れるとこからとは。学類の授業で使った気がするんだがなあ。Jupyter notebookとかだったからマシン的にはノーカンなのかなあ。ちなアイトラッキングはここのやつのとりまコピペしてて、未だ正常に動いてないのでまた頑張らないとなあ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0