Jeg prøver å installere scipy og numpy på Ubuntu 16.04, men jeg får stadig følgende feil. Kan noen fortelle meg hvordan jeg installerer avhengighetene?
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.
Du kan også bruke pip (den alternative Python-pakkeinstallatøren) for å installere numpy og scipy for hele systemet:
sudo apt-get install python-pip
sudo pip install numpy scipy
Dette kan installere det uavhengig av avhengighetsfeil i Ubuntu-pakkebehandleren.
For å installere avhengighetene i alle nåværende støttede versjoner av Ubuntu, åpne terminalen og skriv inn følgende kommandoer:
sudo apt update
sudo apt install --no-install-recommends python2.7-minimal python2.7
sudo apt install python-numpy python-scipy
For Python 3.x
sudo apt update
sudo apt install --no-install-recommends python3-minimal python3
sudo apt install python3-numpy python3-scipy
I mitt tilfelle ønsket jeg scipy installert i et virtuelt miljø i stedet for globalt. Å installere libatlas-base-dev og gfortran før pip-installasjonen løste problemet:
sudo apt-get install libatlas-base-dev
sudo apt-get install gfortran
source .venv/bin/activate
pip install scipy