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

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

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

scikit-learnは、Pythonで使用できるオープンソースプロジェクトの機械学習用ライブラリです。多くの機械学習アルゴリズムが実装されていますが、どのアルゴリズムも同じような書き方で利用できます。

Python

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

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

Q&A

解決済

1回答

4023閲覧

scikit-learnのインストールができない

wokashi

総合スコア2

scikit-learn

scikit-learnは、Pythonで使用できるオープンソースプロジェクトの機械学習用ライブラリです。多くの機械学習アルゴリズムが実装されていますが、どのアルゴリズムも同じような書き方で利用できます。

Python

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

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

0グッド

0クリップ

投稿2021/04/28 13:07

Pythonの機械学習について学ぼうと思いscikit-learnをインストールしようとしたところ、以下のようなエラーが表示されます。どうか解決方法を教えて頂けないでしょうか。MacBook Air(2020、M1)pythonは3.9.2です。

ERROR: Command errored out with exit status 1:
command: /Users/suruga/.pyenv/versions/3.9.2/bin/python /private/var/folders/n7/22kkl_210g92ty5hpp77584w0000gn/T/pip-standalone-pip-sksj9r2x/env_pip.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/n7/22kkl_210g92ty5hpp77584w0000gn/T/pip-build-env-8dgpct4s/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.28.5' 'numpy==1.13.3; python_version=='"'"'3.6'"'"' and platform_machine!='"'"'aarch64'"'"' and platform_system!='"'"'AIX'"'"' and platform_python_implementation=='"'"'CPython'"'"'' 'numpy==1.14.0; python_version=='"'"'3.6'"'"' and platform_machine!='"'"'aarch64'"'"' and platform_system!='"'"'AIX'"'"' and platform_python_implementation!='"'"'CPython'"'"'' 'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_machine!='"'"'aarch64'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.7'"'"' and platform_machine!='"'"'aarch64'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.19.0; python_version=='"'"'3.6'"'"' and platform_machine=='"'"'aarch64'"'"'' 'numpy==1.19.0; python_version=='"'"'3.7'"'"' and platform_machine=='"'"'aarch64'"'"'' 'numpy==1.19.0; python_version=='"'"'3.8'"'"' and platform_machine=='"'"'aarch64'"'"'' 'numpy==1.14.5; python_version=='"'"'3.7'"'"' and platform_machine!='"'"'aarch64'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.17.3; python_version=='"'"'3.8'"'"' and platform_machine!='"'"'aarch64'"'"'' 'numpy==1.19.3; python_version=='"'"'3.9'"'"'' 'scipy>=0.19.1'
cwd: None
Complete output (219 lines):
Ignoring numpy: markers 'python_version == "3.6" and platform_machine != "aarch64" and platform_system != "AIX" and platform_python_implementation == "CPython"' don't match your environment
Ignoring numpy: markers 'python_version == "3.6" and platform_machine != "aarch64" and platform_system != "AIX" and platform_python_implementation != "CPython"' don't match your environment
Ignoring numpy: markers 'python_version == "3.6" and platform_machine != "aarch64" and platform_system == "AIX"' don't match your environment
Ignoring numpy: markers 'python_version == "3.7" and platform_machine != "aarch64" and platform_system == "AIX"' don't match your environment
Ignoring numpy: markers 'python_version == "3.6" and platform_machine == "aarch64"' don't match your environment
Ignoring numpy: markers 'python_version == "3.7" and platform_machine == "aarch64"' don't match your environment
Ignoring numpy: markers 'python_version == "3.8" and platform_machine == "aarch64"' don't match your environment
Ignoring numpy: markers 'python_version == "3.7" and platform_machine != "aarch64" and platform_system != "AIX"' don't match your environment
Ignoring numpy: markers 'python_version == "3.8" and platform_machine != "aarch64"' don't match your environment
Collecting setuptools
Using cached setuptools-56.0.0-py3-none-any.whl (784 kB)
Collecting wheel
Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Collecting Cython>=0.28.5
Using cached Cython-0.29.23-py2.py3-none-any.whl (978 kB)
Collecting numpy==1.19.3
Using cached numpy-1.19.3.zip (7.3 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /Users/suruga/.pyenv/versions/3.9.2/bin/python /var/folders/n7/22kkl_210g92ty5hpp77584w0000gn/T/tmpury6d18y_in_process.py prepare_metadata_for_build_wheel /var/folders/n7/22kkl_210g92ty5hpp77584w0000gn/T/tmpfds535bu
cwd: /private/var/folders/n7/22kkl_210g92ty5hpp77584w0000gn/T/pip-install-ajqd2wki/numpy_1c7c405b11974939986e026035f1740c
Complete output (188 lines):
Running from numpy source directory.
setup.py:480: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
run_build = parse_setuppy_commands()

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

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

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

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

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

meg_

2021/04/28 13:30

> scikit-learnをインストールしようとしたところ 質問者さんが入力したコマンドは何でしょうか?
wokashi

2021/04/28 13:55

pip install scikit-learn です。
guest

回答1

0

ベストアンサー

私はMacユーザではありませんので詳しいことはわかりませんが、エラーメッセージは以下のような感じです。

x86モードのCpython上でscikit-learnをソースからビルドしようとしたところ、マシンのアーキがARMアーキだと認識してビルドを始めたがpythonのアーキと合っていないのでエラーを出して終了します。

scikit-learnを含んだパッケージであるAnacondaをインストールした方が手っ取り早いと思いますが、今のPythonに執着があるのであれば以下のいずれかです。

方法1 ビルド済みのx86用のscikit-learnをインストールする方法を探す。
方法2 Python3.9.1からm1サポート開始とのことですので、ネイティブのpythonを入れて、scikit-learnのソースビルドを楽しむ。

投稿2021/04/28 14:02

ppaul

総合スコア24666

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

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

wokashi

2021/04/28 16:28

回答いただいた通りにscikit-learnを含んだanacondaをインストールしたところ上手くいきました!本当にありがとうございます????
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問