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

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

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

Jupyter (旧IPython notebook)は、Notebook形式でドキュメント作成し、プログラムの記述・実行、その実行結果を記録するツールです。メモの作成や保存、共有、確認などもブラウザ上で行うことができます。

scikit-learn

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

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

Python

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

Q&A

解決済

2回答

1478閲覧

Ubuntu環境におけるScikit-Learn Tutorialの環境構築でconda createができない

ta__ka__da__

総合スコア1

Jupyter

Jupyter (旧IPython notebook)は、Notebook形式でドキュメント作成し、プログラムの記述・実行、その実行結果を記録するツールです。メモの作成や保存、共有、確認などもブラウザ上で行うことができます。

scikit-learn

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

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

Python

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

0グッド

0クリップ

投稿2021/04/17 15:07

teratail初質問です。また、Python等についても初学者のため
おかしな質問をしているかもしれません。予めご了承ください。

前提・実現したいこと

Windowsの中のUbuntu環境でScikit-Learn Tutorialの仮想環境を構築をしたい。

発生している問題・エラーメッセージ

Scikit-Learn Tutorial内の「Installation Notes」のコマンドを実行すると

$ conda create -n skl_tut python=3.4.5 ipywidgets=5.2.2 numpy scipy matplotlib scikit-learn ipython-notebook seaborn pillow Collecting package metadata (current_repodata.json): done Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: failed PackagesNotFoundError: The following packages are not available from current channels: - python=3.4.5 - ipywidgets=5.2.2 - ipython-notebook Current channels: - https://repo.anaconda.com/pkgs/main/linux-64 - https://repo.anaconda.com/pkgs/main/noarch - https://repo.anaconda.com/pkgs/r/linux-64 - https://repo.anaconda.com/pkgs/r/noarch To search for alternate channels that may provide the conda package you're looking for, navigate to https://anaconda.org and use the search bar at the top of the page.

###エラー文で検索してみると
-c conda-forgeオプションを付けると解決するとあったので

$ conda create -n skl_tut -c conda-forge python=3.4.5 ipywidgets=5.2.2 numpy scipy matplotlib scikit-learn ipython-notebook seaborn pillow Collecting package metadata (current_repodata.json): done Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: failed PackagesNotFoundError: The following packages are not available from current channels: - ipython-notebook Current channels: - https://conda.anaconda.org/conda-forge/linux-64 - https://conda.anaconda.org/conda-forge/noarch - https://repo.anaconda.com/pkgs/main/linux-64 - https://repo.anaconda.com/pkgs/main/noarch - https://repo.anaconda.com/pkgs/r/linux-64 - https://repo.anaconda.com/pkgs/r/noarch To search for alternate channels that may provide the conda package you're looking for, navigate to https://anaconda.org and use the search bar at the top of the page.

###ipython-notebookで検索してみると
jupyterと同じとあったので、ipython-notebookをjupyterに変更して

$ conda create -n skl_tut -c conda-forge python=3.4.5 ipywidgets=5.2.2 numpy scipy matplotlib scikit-learn jupyter seaborn pillow Collecting package metadata (current_repodata.json): done Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: / Found conflicts! Looking for incompatible packages. This can take several minutes. Press CTRL-C to abort. Examining conflict for jupyter pillow matplotlib numpy scikit-learn sciExamining conflict for pillow matplotlib numpy scikit-learn scipy: : 15Examining conflict for pillow matplotlib numpy scikit-learn scipy: : 16Examining conflict for ipywidgets matplotlib: : 16it [01:49, 6.67s/it]Examining conflict for scikit-learn scipy numpy: : 17it [01:51, 7.32s/Examining conflict for scikit-learn scipy numpy: : 18it [01:51, 5.63s/Examining conflict for scipy numpy: : 18it [02:07, 5.63s/it] failed UnsatisfiableError: The following specifications were found to be incompatible with each other: Output in format: Requested package -> Available versions これ以降は以下のような記述の繰り返し Package tornado conflicts for: seaborn -> matplotlib-base[version='>=2.1.2'] -> tornado matplotlib -> tornado jupyter -> ipykernel -> tornado[version='>=4|>=4,<6|>=4.0|>=4.2|>=6.1|>=5.0|>=5.0,<7|>=4.1,<7'] ipywidgets=5.2.2 -> ipykernel[version='>=4.2.2'] -> tornado[version='>=4.0|>=4.2']

完了したのか?と思い

$ conda info -e

を実行するも仮想環境は構築されていませんでした。

補足情報(FW/ツールのバージョンなど)

環境
・Windows [10]
・Ubuntu [20.04]
・conda [4.10.1]
・Python [3.8.8]
・ipython [7.22.0]
・jupyter [1.0.0]
・jupyter core [4.7.1]
・jupyter-notebook [6.3.0]
・scikit-learn [0.24.1]
・matplot [3.3.4]
・IPython [7.2.2]
・NumPy [1.19.2]
・SciPy [1.6.2]
・seaborn [0.11.1]

なぜこうなるのか、原因すらわかりません。
初心者質問で恐縮ですが、ご回答宜しくお願い致します。

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

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

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

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

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

ppaul

2021/04/17 22:14

scikit-learn [0.24.1]が入っているのに、Scikit-Learn Tutorialの仮想環境を構築をしたいという理由は何なのでしょうか。 import sklearn でscikit-learnを使えばよいのではないでしょうか?
ta__ka__da__

2021/04/18 02:47

修正依頼ありがとうございます。 jupyter notebookで仮想環境を構築しようとしていました。言葉足らずで申し訳ありません。 回答してくださった方の方法で解決しました。 ありがとうございました。
guest

回答2

0

bsdfan様のご回答通り

$ conda create -n skl_tut ipywidgets numpy scipy matplotlib scikit-learn jupyter notebook seaborn pillow

という形で、バージョン指定をせずにコマンドを実行すると仮想環境を構築することができました。

投稿2021/04/18 02:52

編集2021/04/18 02:52
ta__ka__da__

総合スコア1

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

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

0

ベストアンサー

参考にしているページが古い(更新されていない)ため、バージョンが古かったり、パッケージ名が変わったことに対応できていません。
エラーの原因は、指定したバージョンが古くて、condaのレポジトリから無くなっているとか、バージョン指定していない他のパッケージとの依存関係でその古いバージョンでは動かないとか、という理由です。

対策としては、

plain

1conda create -n skl_tut ipywidgets numpy scipy matplotlib scikit-learn jupyter notebook seaborn pillow

とバージョン指定せずにやることです。
それでバージョン関係の問題が起こるようなら、もう少し新しめのチュートリアルのページを探す方が良いです。

投稿2021/04/18 00:41

編集2021/04/18 00:43
bsdfan

総合スコア4520

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

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

ta__ka__da__

2021/04/18 02:49

ご回答ありがとうございます。 教えていただいた方法で解決しました。 今後、チュートリアルやなにかの記事を参考にする際は それが作成された時期などにも目を向けて行こうと思います。 ありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問