Skip to content

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

Closed

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).

Activity

  1. tacaswell commented on Jun 25, 2014

    @tacaswell
    Member

    what version of mpl and python are you using? This smells like a unicode issue or a bug in windows to me.

  2. anntzer commented on Jun 25, 2014

    @anntzer
    ContributorAuthor

    Python 3.4, matplotlib 1.3.1. I think that this may be related to #2431, but it would be a bit tricky for me to check this.

  3. added this to the v1.4.x milestone on Jun 25, 2014
  4. tacaswell commented on Jun 25, 2014

    @tacaswell
    Member

    One of the window devs will need to test this on master (or if you are feeling brave can you build mpl?).

  5. anntzer commented on Jun 25, 2014

    @anntzer
    ContributorAuthor

    Yes, that's exactly why I said "tricky"...

  6. anntzer commented on Nov 13, 2014

    @anntzer
    ContributorAuthor

    I think the issue has been solved in 1.4.

  7. tacaswell commented on Nov 13, 2014

    @tacaswell
    Member

    Which 1.4.x?

  8. anntzer commented on Nov 13, 2014

    @anntzer
    ContributorAuthor

    At least 1.4.{1,2}

  9. tacaswell commented on Nov 13, 2014

    @tacaswell
    Member

    I am going to close this as a) we fixed a lot of unicode issues and b) @anntzer thinks it is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions