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

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

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

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

Q&A

解決済

2回答

9462閲覧

numpyがインストールできない

kickthekaz

総合スコア29

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

0グッド

0クリップ

投稿2021/01/14 09:14

仕事でmacのM1を授かったので、pythonをインストールしました。

pythonをインストールするときも、pyenvでインストールしようとするとエラーが起きてしまい、homebrewでインストールしました。

次にnumpyをインストールしようとしてるのですが、エラーが発生し、進めません。。

terminal

1pip3 install numpy

すると、ものすごい量のエラーが発生します。。

terminal

1Collecting numpy 2 Using cached numpy-1.19.5.zip (7.3 MB) 3 Installing build dependencies ... done 4 Getting requirements to build wheel ... done 5 Preparing wheel metadata ... done 6Building wheels for collected packages: numpy 7 Building wheel for numpy (PEP 517) ... error 8 ERROR: Command errored out with exit status 1: 9 command: /opt/homebrew/opt/python@3.9/bin/python3.9 /opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/47/k58dkwws5tvg7q36hnbcjrwh0000gn/T/tmpom0aok6p 10 cwd: /private/var/folders/47/k58dkwws5tvg7q36hnbcjrwh0000gn/T/pip-install-g0wt4_9c/numpy_a421050192bd4ff797a7662dd0ce7bf6 11 Complete output (887 lines): 12 Running from numpy source directory. 13 numpy/random/_bounded_integers.pxd.in has not changed 14 numpy/random/_philox.pyx has not changed 15 numpy/random/_bounded_integers.pyx.in has not changed 16 numpy/random/_sfc64.pyx has not changed 17 numpy/random/_mt19937.pyx has not changed 18 numpy/random/bit_generator.pyx has not changed 19 Processing numpy/random/_bounded_integers.pyx 20 numpy/random/mtrand.pyx has not changed 21 numpy/random/_generator.pyx has not changed 22 numpy/random/_pcg64.pyx has not changed 23 numpy/random/_common.pyx has not changed 24 Cythonizing sources 25 blas_opt_info: 26 blas_mkl_info: 27 customize UnixCCompiler 28 libraries mkl_rt not found in 29 30 31省略 32 33 34include altivec.h explicitly 35 clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly 36 error: Command "clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/opt/homebrew/include -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DNO_ATLAS_INFO=3 -DHAVE_CBLAS -Ibuild/src.macosx-11-arm64-3.9/numpy/core/src/umath -Ibuild/src.macosx-11-arm64-3.9/numpy/core/src/npymath -Ibuild/src.macosx-11-arm64-3.9/numpy/core/src/common -Inumpy/core/include -Ibuild/src.macosx-11-arm64-3.9/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/Cellar/python@3.9/3.9.1_4/Frameworks/Python.framework/Versions/3.9/include/python3.9 -Ibuild/src.macosx-11-arm64-3.9/numpy/core/src/common -Ibuild/src.macosx-11-arm64-3.9/numpy/core/src/npymath -c numpy/core/src/multiarray/alloc.c -o build/temp.macosx-11-arm64-3.9/numpy/core/src/multiarray/alloc.o -MMD -MF build/temp.macosx-11-arm64-3.9/numpy/core/src/multiarray/alloc.o.d -faltivec -I/System/Library/Frameworks/vecLib.framework/Headers" failed with exit status 1 37 ---------------------------------------- 38 ERROR: Failed building wheel for numpy 39Failed to build numpy 40ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly

##試したこと

terminal

1pip3 install --upgrade pip setuptools wheel

どなたかお願いしますm(_ _)m

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

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

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

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

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

guest

回答2

0

ベストアンサー

まだM1バイナリのPythonでnumpyはサポートされてません。

https://github.com/numpy/numpy/issues/18160#issuecomment-759707302

No :0 M1 is not supported, we are working on it but we also need hardware testing support that we do not yet have. There are other issues open for this.

IntelバイナリのPythonをRosettaで動かしてください。

投稿2021/01/14 09:46

編集2021/01/14 09:48
quickquip

総合スコア11038

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

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

_whitecat_22

2021/01/14 09:49

未対応でしたか。。 quickquipさん、ありがとうございます。
kickthekaz

2021/01/14 13:23

なるほどですね、、 ありがとうございます。
guest

0

少し調べただけですが、以下のコマンドではいかがでしょうか。

Terminal

1$ py -m pip install numpy 2 3もしくは 4 5$ brew install homebrew/python/numpy --with-python3

投稿2021/01/14 09:22

_whitecat_22

総合スコア1305

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

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

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問