ImportError: cannot import name 'ft2font'

I’m running Python 3.6.9 on Linux Ubuntu 18.04

When I run pytest I get an error called ImportError: cannot import name 'ft2font'

In detail, I get the following.

During handling of the above exception, another exception occurred:
../../.local/lib/python3.6/site-packages/_pytest/config.py:376: in _importconftest
    mod = conftestpath.pyimport()
../../.local/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
lib/matplotlib/__init__.py:174: in <module>
    _check_versions()
lib/matplotlib/__init__.py:159: in _check_versions
    from . import ft2font
E   ImportError: cannot import name 'ft2font'

Is this something to do with my Python or Matplotlib installation?

1 Like

How did you install?