如何在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. 

您还可以使用pip(替代Python包安装程序)为整个系统安装numpy和scipy:

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

无论Ubuntu包管理器中的依赖性错误如何,都可以安装它。

要在所有当前支持的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