質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.46%
Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Q&A

解決済

1回答

1705閲覧

pyenv で python のインストールでエラーになる

ray.prorsum

総合スコア73

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

0グッド

0クリップ

投稿2020/09/14 01:28

macOS 10.15.6(Catalina)にて、pyenv で

shell

1pyenv install 3.6.11

と入れると

python-build: use openssl@1.1 from homebrew python-build: use readline from homebrew Downloading Python-3.6.11.tar.xz... -> https://www.python.org/ftp/python/3.6.11/Python-3.6.11.tar.xz Installing Python-3.6.11... python-build: use readline from homebrew python-build: use zlib from xcode sdk BUILD FAILED (OS X 10.15.6 using python-build 20180424) Inspect or clean up the working tree at /var/folders/66/ggg5xl991933f9ctjtv78ync0000gn/T/python-build.20200914100109.18238 Results logged to /var/folders/66/ggg5xl991933f9ctjtv78ync0000gn/T/python-build.20200914100109.18238.log Last 10 log lines: ^ 216 warnings and 10 errors generated. make: *** [Programs/python.o] Error 1 make: *** Waiting for unfinished jobs.... 216 warnings and 10 errors generated. 216 warnings and 10 errors generated. 216 warnings and 10 errors generated. make: *** [Parser/grammar1.o] Error 1 make: *** [Parser/listnode.o] Error 1 make: *** [Parser/acceler.o] Error 1

とエラーになってしまいます。
log を見ると最後の方で以下のような記載がありますが、どう対処していいのか分からない状態です。

In file included from Parser/listnode.c:4: In file included from ./Include/pgenheaders.h:10: In file included from In file included from Parser/acceler.c:13: In file included from ./Include/pgenheaders.h:10: In file included from ./Include/Python.h:36: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:72: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/unistd.h:202: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h:31:25: error: cannot combine with previous 'type-name' declaration specifier typedef __darwin_gid_t gid_t; ^ ./pyconfig.h:1513:15: note: expanded from macro 'gid_t' #define gid_t int ^ In file included from Parser/acceler.c:13: In file included from ./Include/pgenheaders.h:10: In file included from ./Include/Python.h:36: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:72: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/unistd.h:202: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h:31:1: warning: typedef requires a name [-Wmissing-declarations] typedef __darwin_gid_t gid_t; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./Include/Python.h:36: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:72: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/unistd.h:202: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h:31:25: error: cannot combine with previous 'type-name' declaration specifier typedef __darwin_gid_t gid_t; ^ ./pyconfig.h:1513:15: note: expanded from macro 'gid_t' #define gid_t int ^ In file included from Parser/listnode.c:4: In file included from ./Include/pgenheaders.h:10: In file included from ./Include/Python.h:36: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:72: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/unistd.h:202: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h:31:1: warning: typedef requires a name [-Wmissing-declarations] typedef __darwin_gid_t gid_t; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from Parser/grammar1.c:4: In file included from ./Include/Python.h:53: In file included from ./Include/pyport.h:205: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/time.h:184: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/time.h:69: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h:31:33: error: 'long type-name' is invalid typedef __darwin_clock_t clock_t; ^ ./pyconfig.h:1507:17: note: expanded from macro 'clock_t' #define clock_t long ^ In file included from Parser/grammar1.c:4: In file included from ./Include/Python.h:53: In file included from ./Include/pyport.h:205: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/time.h:184: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/time.h:69: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h:31:1: warning: typedef requires a name [-Wmissing-declarations] typedef __darwin_clock_t clock_t; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ./Programs/python.c:3: In file included from ./Include/Python.h:89: ./Include/unicodeobject.h:68:2: error: Must define SIZEOF_WCHAR_T #error Must define SIZEOF_WCHAR_T ^ In file included from Parser/acceler.c:13: In file included from ./Include/pgenheaders.h:10: In file included from ./Include/Python.h:53: In file included from ./Include/pyport.h:205: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/time.h:184: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/time.h:69: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h:31:33: error: 'long type-name' is invalid typedef __darwin_clock_t clock_t; ^ ./pyconfig.h:1507:17: note: expanded from macro 'clock_t' #define clock_t long ^ In file included from Parser/acceler.c:13: In file included from ./Include/pgenheaders.h:10: In file included from ./Include/Python.h:53: In file included from ./Include/pyport.h:205: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/time.h:184: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/time.h:69: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h:31:1: warning: typedef requires a name [-Wmissing-declarations] typedef __darwin_clock_t clock_t; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from Parser/listnode.c:4: In file included from ./Include/pgenheaders.h:10: In file included from ./Include/Python.h:53: In file included from ./Include/pyport.h:205: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/time.h:184: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/time.h:69: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h:31:33: error: 'long type-name' is invalid typedef __darwin_clock_t clock_t; ^ ./pyconfig.h:1507:17: note: expanded from macro 'clock_t' #define clock_t long ^ In file included from Parser/listnode.c:4: In file included from ./Include/pgenheaders.h:10: In file included from ./Include/Python.h:53: In file included from ./Include/pyport.h:205: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/time.h:184: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/time.h:69: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h:31:1: warning: typedef requires a name [-Wmissing-declarations] typedef __darwin_clock_t clock_t; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from Parser/grammar1.c:4: In file included from ./Include/Python.h:89: ./Include/unicodeobject.h:68:2: error: Must define SIZEOF_WCHAR_T #error Must define SIZEOF_WCHAR_T ^ In file included from Parser/acceler.c:13: In file included from ./Include/pgenheaders.h:10: In file included from ./Include/Python.h:89: ./Include/unicodeobject.h:68:2: error: Must define SIZEOF_WCHAR_T #error Must define SIZEOF_WCHAR_T ^ In file included from Parser/listnode.c:4: In file included from ./Include/pgenheaders.h:10: In file included from ./Include/Python.h:89: ./Include/unicodeobject.h:68:2: error: Must define SIZEOF_WCHAR_T #error Must define SIZEOF_WCHAR_T ^ 216 warnings and 10 errors generated. make: *** [Programs/python.o] Error 1 make: *** Waiting for unfinished jobs.... 216 warnings and 10 errors generated. 216 warnings and 10 errors generated. 216 warnings and 10 errors generated. make: *** [Parser/grammar1.o] Error 1 make: *** [Parser/listnode.o] Error 1 make: *** [Parser/acceler.o] Error 1

pyenv の python インストール系で記事になっているものはいくつか試しました(エラーコードが異なるので、的外れだとは思いますが)。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

clang が anaconda 経由のものと、xcode 経由ものが存在しており、本来であれば後者で実行すべきところを、前者で実行していたのが原因でした。
anadonda 環境を削除したところ上手く動きました。

投稿2020/09/14 02:53

ray.prorsum

総合スコア73

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.46%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問