Skip to content

On Windows, matplotlib fails to load fonts when installed to a folder with non-ascii path #3148

@anntzer

Description

@anntzer

After installing matplotlib (on Windows, via miniconda) to a non-ascii path, running

python -c "from matplotlib import pyplot as plt; plt.xlabel('$x$'); plt.show()"

fails with a long traceback that ends with

File "C:/non/ascii/path/to/matplotlib/mathtext.py", line 584, in _get_font
    font = FT2Font(str(basename))
RuntimeError: Could not open facefile C:/non/ascii/path/to/matplotlib/mpl-data/fonts/ttf/Vera.ttf; Cannot_Open_Resource

Note that this is specific to Windows (I wasn't able to reproduce the issue by creating a virtualenv on Linux) and to non-ascii paths (changing the path solved the issue).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions