1

I install python-apscheduler, but dependent python-concurrent.futures not installed.

Is this package bug?

Environment:

$ 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

Procedure

Install python-apscheduler

$ sudo apt install python-apscheduler

Prepare the following script

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

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

If I execute it, an error will occur.

$ 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 is not installed:

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

apt depends doesn't show 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 is written in debian/control. I get apscheduler_3.4.0-2ubuntu1.debian.tar.xz from the package index.

See debian/control:

Source: apscheduler
Section: python
Priority: optional
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
XSBC-Original-Maintainer: Laszlo Boszormenyi (GCS) <gcs@debian.org>
Build-Depends: debhelper (>= 11), dh-python,
 python-all (>= 2.7),
 python-setuptools, python-setuptools-scm,
 python-concurrent.futures, python-tzlocal, python-six, python-pytest,
muru
  • 197,895
  • 55
  • 485
  • 740
miwarin
  • 133
  • 5

1 Answers1

1

This is a packaging bug. The PyPi version of apcheduler does depend on futures, so python-concurrent.futures should have been a Depends of python-apscheduler. I suspect the reason this has gone unnoticed is that there are only two other packages that depend on python-apscheduler:

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

Of which, python-watcher indirectly depends on python-concurrent.futures via other packages. And archipel-agent-action-scheduler died sometime in May 2018, so I doubt there are many users of it.

muru
  • 197,895
  • 55
  • 485
  • 740