AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1383002
Accepted
Py-ser
Py-ser
Asked: 2021-12-21 13:23:16 +0800 CST2021-12-21 13:23:16 +0800 CST 2021-12-21 13:23:16 +0800 CST

E: 包 'python-scipy' 没有安装候选

  • 772

安装软件后,我多次发现以下错误:

$ 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

我真的不确定发生了什么?我在另一个线程上读到 20.04 LTS 存储库有 NumPy,但没有 SciPy。

编辑:

$ 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
apt
  • 1 1 个回答
  • 4428 Views

1 个回答

  • Voted
  1. Best Answer
    pLumo
    2021-12-21T13:41:52+08:002021-12-21T13:41:52+08:00

    在 ubuntu 存储库中查找包的最佳来源是packages.ubuntu.com

    你可以搜索 scipyuniverse会看到,它是从18.04 之后取出的。

    我只能推测原因,也许找不到该软件包的维护者。

    但是,您可以通过以下方式轻松安装它pip:

    sudo apt install python3-pip
    pip install scipy
    

    请注意,这pip将默认为您的本地用户安装软件包。如果您需要与其他用户或其他用户一起运行python脚本sudo,则需要在系统范围内安装它:

    sudo pip install scipy
    

    如果您python仍然无法识别包裹,您可能需要检查是否python有链接到python2. 检查与python --version。

    • 2

相关问题

  • 如何编写 shell 脚本来安装应用程序列表?

  • 如何查看存档中可用的软件包的所有版本?

  • 是否可以说出我安装的哪些软件包不在原版安装中?

  • 如何删除 PPA?

  • 使用 apt-get upgrade 时如何强制安装内核更新?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve