Ich versuche, scipy und numpy auf Ubuntu 16.04 zu installieren, aber ich erhalte immer den folgenden Fehler. Kann mir jemand sagen, wie man die Abhängigkeiten zu installieren?
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.
Sie können auch pip (das alternative Python-Paketinstallationsprogramm) verwenden, um numpy und scipy für das gesamte System zu installieren:
sudo apt-get install python-pip
sudo pip install numpy scipy
Dies könnte sie unabhängig von Abhängigkeitsfehlern im Ubuntu-Paketmanager installieren.
Um die Abhängigkeiten in allen derzeit unterstützten Versionen von Ubuntu zu installieren, öffnen Sie das Terminal und geben Sie die folgenden Befehle ein:
sudo apt update
sudo apt install --no-install-recommends python2.7-minimal python2.7
sudo apt install python-numpy python-scipy
Für Python 3.x
sudo apt update
sudo apt install --no-install-recommends python3-minimal python3
sudo apt install python3-numpy python3-scipy
In meinem Fall wollte ich scipy in einer virtuellen Umgebung statt global installieren. Die Installation von libatlas-base-dev und gfortran vor der pip-Installation löste das Problem:
sudo apt-get install libatlas-base-dev
sudo apt-get install gfortran
source .venv/bin/activate
pip install scipy