Python v3.7 CI Runner - dbus-python can't be installed

Getting a build error with Travis CI I never had before with Python v3.7

DBUS Python works fine for Python 3.6, 3.8, 3.9, and 3.10 (in Travis Runners). It’s just 3.7 that is recently broken.

The exact error is as follows:

Collecting dbus-python

  Downloading dbus-python-1.3.2.tar.gz (605 kB)

  Installing build dependencies ... done

  Getting requirements to build wheel ... error

  error: subprocess-exited-with-error


  × Getting requirements to build wheel did not run successfully.

  │ exit code: 1

  ╰─> [22 lines of output]

      Traceback (most recent call last):

        File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/", line 363, in <module>


        File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/", line 345, in main

          json_out['return_val'] = hook(**hook_input['kwargs'])

        File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/", line 130, in get_requires_for_build_wheel

          return hook(config_settings)

        File "/tmp/pip-build-env-moyuvu18/overlay/lib/python3.7/site-packages/mesonpy/", line 923, in get_requires_for_build_wheel

          with _project(config_settings) as project:

        File "/opt/python/3.7.1/lib/python3.7/", line 112, in __enter__

          return next(self.gen)

        File "/tmp/pip-build-env-moyuvu18/overlay/lib/python3.7/site-packages/mesonpy/", line 903, in _project


        File "/opt/python/3.7.1/lib/python3.7/", line 112, in __enter__

          return next(self.gen)

        File "/tmp/pip-build-env-moyuvu18/overlay/lib/python3.7/site-packages/mesonpy/", line 547, in with_temp_working_dir

          yield cls(source_dir, tmpdir, build_dir)

        File "/tmp/pip-build-env-moyuvu18/overlay/lib/python3.7/site-packages/mesonpy/", line 424, in __init__

          import pyproject_metadata  # noqa: F811

        File "/tmp/pip-build-env-moyuvu18/overlay/lib/python3.7/site-packages/pyproject_metadata/", line 13, in <module>

          from typing import Any, DefaultDict, Dict, List, Mapping, Optional, OrderedDict, Tuple, Union

      ImportError: cannot import name 'OrderedDict' from 'typing' (/opt/python/3.7.1/lib/python3.7/

      [end of output]

typing.OrderedDict was added in Python 3.7.2, while you’re running Python 3.7.1 in your tests. It looks like you need a newer Python 3.7 version.

1 Like

Awesome! Thank you for pointing this out. It looks like it’s been Python 3.7.1 for a while then i guess and just recently the packages that build against it have been updated to a newer version (requiring that Python also have been updated).

I would have hoped that only referencing up to the minor version would have always used the stable/latest branch (hence this):

          # only uses Python v3.7.1 :(
          - python: "3.7"
            env: TOXENV=py37

The following fixed it thanks to your awesome point:

          # Current support version
          - python: "3.7.7"
            env: TOXENV=py37

Is there a trick i can identify the python version to always take the latest (like :latest for example with Docker)?

Thanks again for your help!