3

I've been trying to install some Python libraries and packages and keep getting this error. This is a sample but the same issue i face with matplotlib and panda and so on.

sudo apt-get install python-scipy 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python-scipy is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python-scipy' has no installation candidate

I tried enabling universe repository andit turns out it is already enabled. So i can't figure out the issue yet. Thank in advance for your help.

Mt Badr
  • 33
  • 1
  • 1
  • 3
  • 3
    Does this answer your question? [What does "Package has no installation candidate" mean?](https://askubuntu.com/questions/14685/what-does-package-package-has-no-installation-candidate-mean) – karel Sep 22 '20 at 10:02
  • 5
    The package is python2 specific, python2 is EOL & all non-ported code was largely removed from repositories (https://launchpad.net/ubuntu/+source/python-scipy/+publishinghistory); both Debian & Ubuntu. – guiverc Sep 22 '20 at 10:32

3 Answers3

9

The package you want is python3-scipy, not python-scipy. It can be installed using:

apt install python3-scipy

You might be better off to install scipy via pip (for Python 2) or pip3 (for Python 3). pip is a package manager for Python packages.

pip install scipy

or

pip3 install scipy

If you run into a similar problem in the future, you can use pip3 search scipy with the relevant search term to look for the required package. Check out man pip3 for the details.

BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
leggewie
  • 998
  • 6
  • 9
2

Python 2 is EOL, but...

you can still install this package by downloading it from 18.04 LTS repository with

cd ~/Downloads
wget http://archive.ubuntu.com/ubuntu/pool/universe/p/python-scipy/python-scipy_0.19.1-2ubuntu1_amd64.deb
sudo apt-get install ./python-scipy_0.19.1-2ubuntu1_amd64.deb

and then use it was planned.


Note: what is interesting - the 20.04 LTS repository has NumPy, but does not have SciPy. Very strange decision as from user point-of-view.

N0rbert
  • 97,162
  • 34
  • 239
  • 423
1

Just do this in Ubuntu

sudo apt install python3-numpy python3-scipy python3-matplotlib python3-pandas python3-sympy python3-nose

Ir Mi
  • 11
  • 1