私のローカルマシンで実行しようとしています。私はエラーが発生する ImportError:jupyterノートブックでのみ 'sklearn'という名前のモジュールはありません carnd-term1 envを有効化/無効化したコマンドラインからPythonを使用するとうまく動作します。Jupyter Notebook ImportError: 'sklearn'という名前のモジュールがありません
私はpip、apt-get、condaでsklearnをインストールしました。また、コンディションアップグレードscikit-learnを試みました。 envを有効または無効にします。
(carnd-term1) [email protected]:~/sdc$ conda upgrade scikit-learn
Fetching package metadata .........
Solving package specifications: .
# All requested packages already installed.
# packages in environment at /home/matt/anaconda3/envs/carnd-term1:
#
scikit-learn 0.18.1 np112py35_1
(carnd-term1) [email protected]:~/sdc$ python3
Python 3.5.2 | packaged by conda-forge | (default, Jan 19 2017, 15:28:33)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sklearn
>>>
...: (carnd-term1) [email protected]:~/sdc$ ipython
...: Python 3.5.2 | packaged by conda-forge | (default, Jan 19 2017, 15:28:33)
...: Type "copyright", "credits" or "license" for more information.
...:
...: IPython 5.1.0 -- An enhanced Interactive Python.
...: ? -> Introduction and overview of IPython's features.
...: %quickref -> Quick reference.
...: help -> Python's own help system.
...: object? -> Details about 'object', use 'object??' for extra details.
...:
...: In [1]: import sklearn
...:
...: In [2]: from sklearn.model_selection import train_test_split
...:
...: In [3]: (carnd-term1) [email protected]:~/sdc$ ipython
...: ...: Python 3.5.2 | packaged by conda-forge | (default, Jan 19 2017, 15:28:33)
...: ...: Type "copyright", "credits" or "license" for more information.
...: ...:
...: ...: IPython 5.1.0 -- An enhanced Interactive Python.
...: ...: ? -> Introduction and overview of IPython's features.
...: ...: %quickref -> Quick reference.
...: ...: help -> Python's own help system.
...: ...: object? -> Details about 'object', use 'object??' for extra details.
...: ...:
...: ...: In [1]: import sklearn
...: ...:
...: ...: In [2]: from sklearn.model_selection import train_test_split
...: ...:
...: ...: In [3]:
jupyterノートからは動作しません。
アイデア?
この環境にjupyterノートブックをインストールしましたか? – darthbith