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

Publish date: 2024-05-21

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?

1 Answer

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

apt install python3-scipy 

You might be better off installing 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.

1

ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJobmlsYmqGdn2OnmSpmZOgrqixjKmwraCfo3q0r8ipsGagkah6r7uMoqWsrJGhuaLAyKilZpuRo7GqsMCtnA%3D%3D