【问题标题】:E: Package 'python-scipy' has no installation candidateE: 包 'python-scipy' 没有安装候选
【发布时间】:2022-01-22 07:32:38
【问题描述】:

在安装软件时,我多次发现以下错误。

$ 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

我可以安装许多缺少的模块,例如 sudo apt-get install -y python-numpy,但有时我会得到:

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

我真的不确定发生了什么?

【问题讨论】:

    标签: installation pip package setup.py


    【解决方案1】:

    你想要的包是python3-scipy,而不是python-scipy。可以使用以下方式安装:

    apt install python3-scipy
    

    您最好通过 pip(对于 Python 2)或 pip3(对于 Python 3)安装 scipy。 pip 是 Python 包的包管理器。

    pip install scipy
    

    pip3 install scipy
    

    如果以后遇到类似问题,可以使用 pip3 search scipy 和相关搜索词来查找需要的包。详情请查看 manpip3

    【讨论】:

    • 让我知道这是否适合你,我可以更新它
    猜你喜欢
    • 2021-01-19
    • 2021-02-10
    • 2021-04-23
    • 1970-01-01
    • 2022-08-14
    • 2022-11-09
    • 2019-08-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多