2016-06-17 24 views
1

numpy、scipy、scikit learnなどの必要なパッケージがインストールされています。それでもPythonでインポートしようとすると、モジュールが見つかりません。パッケージをインストールした後でもインポートできません

pip install -U numpy scipy scikit-learn 
Requirement already up-to-date: numpy in /usr/lib/python2.7/dist-packages 
Collecting scipy 
    Downloading scipy-0.17.1-cp27-cp27mu-manylinux1_x86_64.whl (39.5MB) 
    100% |████████████████████████████████| 39.5MB 32kB/s 
Requirement already up-to-date: scikit-learn in /home/tecsadmin/.local/lib/python2.7/site-packages 
Installing collected packages: scipy 
    Found existing installation: scipy 0.17.0 
    DEPRECATION: Uninstalling a distutils installed project (scipy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project. 
    Uninstalling scipy-0.17.0: 
Exception: 
Traceback (most recent call last): 
    File "/home/tecsadmin/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main 
    status = self.run(options, args) 
    File "/home/tecsadmin/.local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run 
    prefix=options.prefix_path, 
    File "/home/tecsadmin/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 736, in install 
    requirement.uninstall(auto_confirm=True) 
    File "/home/tecsadmin/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 742, in uninstall 
    paths_to_remove.remove(auto_confirm) 
    File "/home/tecsadmin/.local/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove 
    renames(path, new_path) 
    File "/home/tecsadmin/.local/lib/python2.7/site-packages/pip/utils/__init__.py", line 267, in renames 
    shutil.move(old, new) 
    File "/usr/lib/python2.7/shutil.py", line 303, in move 
    os.unlink(src) 
OSError: [Errno 13] Permission denied: '/usr/lib/python2.7/dist-packages/scipy-0.17.0.egg-info' 
[email protected]:~/.local/lib/python2.7/site-packages/sklearn/__check_build$ python 
Python 2.7.5 (default, Jun 17 2016, 04:41:21) 
[GCC 5.3.1 20160413] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import numpy 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named numpy 
>>> 

更新

[email protected]:~$ sudo pip install -U numpy scipy scikit-learn 
[sudo] password for tecsadmin: 
The directory '/home/tecsadmin/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
The directory '/home/tecsadmin/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
Requirement already up-to-date: numpy in /usr/lib/python2.7/dist-packages 
Collecting scipy 
    Downloading scipy-0.17.1-cp27-cp27mu-manylinux1_x86_64.whl (39.5MB) 
    100% |████████████████████████████████| 39.5MB 32kB/s 
Requirement already up-to-date: scikit-learn in ./.local/lib/python2.7/site-packages 
Installing collected packages: scipy 
    Found existing installation: scipy 0.17.0 
    DEPRECATION: Uninstalling a distutils installed project (scipy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project. 
    Uninstalling scipy-0.17.0: 
     Successfully uninstalled scipy-0.17.0 
Successfully installed scipy-0.17.1 
[email protected]:~$ python 
Python 2.7.5 (default, Jun 17 2016, 04:41:21) 
[GCC 5.3.1 20160413] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import numpy 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named numpy 
>>> import scipy 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named scipy 

UPDATE 2

関連しているが、あなたが permission deniedエラーがある場合、としてみてください
[email protected]:~$ pip freeze | grep numpy 
numpy==1.11.0 
[email protected]:~$ pip freeze | grep scipy 
scipy==0.17.1 
[email protected]:~$ pip freeze | grep scikit-learn 
scikit-learn==0.17.1 
[email protected]:~$ python 
Python 2.7.5 (default, Jun 17 2016, 04:41:21) 
[GCC 5.3.1 20160413] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import scipy 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named scipy 
>>> import numpy 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named numpy 
+0

ライブラリをインストールしなかったため、エラーが発生しました。 – syntonym

+0

@ user123 sudo pip install -U numpy scipy scikit-learn – wind85

+0

@ wind85アップデートをお願いします – user123

答えて

2

わからない sudo pip install -U numpy scipy scikit-learn

また、私は、sudoでプレイしているあなたがそうあなたがいけない https://virtualenv.pypa.io/en/stable/のpython仮想環境を使用することをお勧め

pip freeze

$ pip freeze | grep numpy 
$ numpy==1.9.2 

インストールの実行、それがsuccesfuly

をインストールされている場合、あなたが本当にチェックする方法を再確認するために、許可

+0

これで3つのすべてについて既に満足しているというメッセージが表示されます – user123

+0

run pip凍結、numpyとscipyがインストールされていることを確認しましょう – lapinkoira

+0

chekc update – user123

1

エラー13のアクセス権が拒否されたライブラリをインストールしていません。

sudo pip install numpy scipy scikit-learn 
+0

Sudoを使ってインストールしましたが、同じエラーが表示されます。 – user123

+0

@ user123 -Uコマンドライン引数を削除します。 – wind85

+0

これで3つすべての要求がすでに満たされていると言います。 – user123

関連する問題