web-dev-qa-db-ja.com

Ubuntu 16.04にscipyとnumpyをインストールする方法は?

Ubuntu 16.04にscipyとnumpyをインストールしようとしていますが、次のエラーが発生し続けます。依存関係のインストール方法を教えてもらえますか?

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python-numpy : Depends: python:any (>= 2.7.5-5~)
 E: Unable to correct problems, you have held broken packages.
16
Rahul

また、pip(代替Pythonパッケージインストーラー)を使用して、システム全体にnumpyとscipyをインストールすることもできます。

Sudo apt-get install python-pip  
Sudo pip install numpy scipy

これにより、Ubuntuパッケージマネージャーの依存関係エラーに関係なくインストールできます。

24
don.joey

Ubuntuの現在サポートされているすべてのバージョンに依存関係をインストールするには、ターミナルを開き、次のコマンドを入力します。

Sudo apt update  
Sudo apt install --no-install-recommends python2.7-minimal python2.7  
Sudo apt install python-numpy python-scipy

Python 3.xの場合

Sudo apt update  
Sudo apt install --no-install-recommends python3-minimal python3  
Sudo apt install python3-numpy python3-scipy
3
karel