python-apscheduler:依赖的 python-concurrent.futures 未安装

python-apscheduler:依赖的 python-concurrent.futures 未安装

我安装了python-apscheduler,但是依赖项python-concurrent.futures没有安装。

这个包有 bug 吗?

环境:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic
$ python --version
Python 2.7.17

程序

安装 python-apscheduler

$ sudo apt install python-apscheduler

准备以下脚本

$ cat a.py
from apscheduler.schedulers.blocking import BlockingScheduler
from apscheduler.executors.pool import ThreadPoolExecutor

if __name__ == '__main__':
  print "hello"

如果我执行它,就会发生错误。

$ python a.py 
Traceback (most recent call last):
  File "a.py", line 1, in <module>
    from apscheduler.schedulers.blocking import BlockingScheduler
  File "/usr/lib/python2.7/dist-packages/apscheduler/schedulers/blocking.py", line 5, in <module>
    from apscheduler.schedulers.base import BaseScheduler, STATE_STOPPED
  File "/usr/lib/python2.7/dist-packages/apscheduler/schedulers/base.py", line 17, in <module>
    from apscheduler.executors.pool import ThreadPoolExecutor
  File "/usr/lib/python2.7/dist-packages/apscheduler/executors/pool.py", line 2, in <module>
    import concurrent.futures
ImportError: No module named concurrent.futures

python-concurrent.futures未安装:

$ apt list --installed python-apscheduler python-concurrent.futures
Listing... Done
python-apscheduler/bionic,bionic,now 3.4.0-2ubuntu1 all [installed]

apt depends不显示python-concurrent.futures

$ apt depends python-apscheduler
python-apscheduler
  Depends: python-pkg-resources
  Depends: python-six (>= 1.4.0)
  Depends: python-tz
  Depends: python-tzlocal
  Depends: <python:any> (<< 2.8)
    python:i386
    python
  Depends: <python:any> (>= 2.7.5-5~)
    python:i386
    python

Build-Depends: python-concurrent.futures写在debian/control。我从包索引

debian/control

Source: apscheduler
Section: python
Priority: optional
Maintainer: Ubuntu Developers <[email protected]>
XSBC-Original-Maintainer: Laszlo Boszormenyi (GCS) <[email protected]>
Build-Depends: debhelper (>= 11), dh-python,
 python-all (>= 2.7),
 python-setuptools, python-setuptools-scm,
 python-concurrent.futures, python-tzlocal, python-six, python-pytest,

答案1

这是一个打包错误。 的 PyPi 版本apcheduler确实依赖于futures,因此python-concurrent.futures应该是 的Dependspython-apscheduler我怀疑这个问题没有被注意到的原因是只有另外两个软件包依赖于python-apscheduler

# apt-cache rdepends python-apscheduler
python-apscheduler
Reverse Depends:
  python-watcher
  archipel-agent-action-scheduler

其中,python-watcher间接依赖于python-concurrent.futures其他包。并archipel-agent-action-scheduler在某个时候死亡2018 年 5 月,所以我怀疑它的用户并不多。

相关内容