E: Package 'python-scipy' has no installation candidate
Upon installing a software, I am finding the following error multiple times:
$ sudo python setup.py install
Traceback (most recent call last):
File "setup.py", line 24, in <module>
from software_name import PACKAGE_NAME
File "/home/username/Softwares/software_name/__init__.py", line 29, in <module>
import scipy
ImportError: No module named scipy
I can install many of the missing modules with, e.g., sudo apt-get install -y python-numpy
, but sometimes I get:
username@username:~/Softwares/software_name$ sudo apt-get install -y 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
And I am really not sure what is going on? I have read on another thread that the 20.04 LTS repository has NumPy, but does not have SciPy.
EDIT:
$ sudo apt install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-pip 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
However the following packages replace it:
python3-pip
E: Package 'python-pip' has no installation candidate
$ pip install scipy
Requirement already satisfied: scipy in /usr/lib/python3/dist-packages (1.3.3)
$ sudo apt install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (20.0.2-5ubuntu1.6).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ sudo pip install scipy
[sudo] password for user_name:
Requirement already satisfied: scipy in /usr/lib/python3/dist-packages (1.3.3)
$ python --version
Python 2.7.18
Best source for looking up packages in ubuntu repositories is packages.ubuntu.com
You can search for scipy and will see, that it was taken out from the universe
after 18.04.
I can only speculate about the reason, maybe no maintainer for the package could be found.
However, you can easily install it via pip
:
sudo apt install python3-pip
pip install scipy
Note, that pip
will default to install a package to your local user. If you need to run a python
script with sudo
or another user, you need to install it systemwide with:
sudo pip install scipy
If your python
still not recognize the package, you may need to check if python
maybe links to python2
. Check with python --version
.