FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Import hangs when importing pyplot · Issue #2919 · matplotlib/matplotlib · GitHub

Repository navigation

Import hangs when importing pyplot #2919

Closed

Description

This is another font issue. This is similar to this one, although the solution found there doesn't work for me. I am on OSX 10.6 using python 2.7.6. I installed the latest via git. That went fine. I can import matplotlib:

import matplotlib
print matplotlib.__version__
=> 1.4.x

Now if I do:

import matplotlib.pyplot

I get nothing. It just hangs. This is the traceback which is what leads me to believe that this a font manager issue: https://gist.github.com/chestervonwinchester/9725539

Activity

  1. notmatthancock commented on Mar 25, 2014

    ContributorAuthor

    I found some related issues. It turns out my fontCache got deleted from the ~/.matplotlib/ directory. Where the import was appearing to stall, was just the fc-list call be executed. This call took about 10 or 15 minutes to execute, but now that the cache is built, everything is dandy.

  2. WeatherGod commented on Mar 25, 2014

    Member

    10 to 15 minutes?!

    The most I have ever seen was 2 minutes. Maybe we need to do something to
    at least output a message (via logging, of course) to give a user a heads
    up on what might be happening. Another thing to look into is to see how we
    could constrain the fc-list call to keep it from taking a ridiculous amount
    of time.

    On Tue, Mar 25, 2014 at 12:06 PM, chestervonwinchester <
    notifications@github.com> wrote:

    Closed #2919 #2919.

    Reply to this email directly or view it on GitHubhttps://github.com//issues/2919
    .

  3. mdboom commented on Mar 25, 2014

    Member

    How many fonts to you have installed on your system? Are any on slow media, such as network drives? 10-15 minutes seems way out of line. fc-list takes 0.022 seconds on my system.

  4. notmatthancock commented on Mar 25, 2014

    ContributorAuthor

    Ok I apologize. My impatience is warping my perception of time because:

    $ time fc-list
    ....font lists...
    real    1m44.781s
    user    0m59.607s
    sys 0m23.015s
    

    In any case, I think you're right about an output message because this could've been resolved by simply letting the thing run. Instead, I assumed there was an error, and continued aborting and hunting tracebacks. Perhaps if there was a check to see if the matplotlib fontCache exists and if not, prompt a message.

    I have ~2461 fonts and no slow media.

  5. ialexryan commented on Dec 8, 2015

    Why is this closed? Even if the solution is as simple as running fc-list, there should be some sort of error instead of just hanging forever.

  6. jenshnielsen commented on Dec 8, 2015

    Member

    Because that is not the solution. What happens is that matplotlib calls fc-list on the first import of pyplot to create the font cache. Unfortunately this can be really slow on some systems but it's not really an issue in matplotlib. No where in this issue is there any indication of anything hanging forever. It will hang for the time it takes to execute fc-list only.

  7. ialexryan commented on Dec 8, 2015

    Sorry, I meant forever in the colloquial sense. Most users have been trained by convention to expect that any program that produces no visual output for more than several seconds without warning has crashed - I know I have. Could we at least print a line saying something like "Running fc-list. This may take up to several minutes." ?

  8. RichardoC commented on Apr 11, 2016

    I'm also suffering from a slow fc-list import. A warning in the console would be appreciated. The only reason I spotted that the kernel wasn't hung was due to htop.

  9. jenshnielsen commented on Apr 12, 2016

    Member

    @RichardoC there already is a warning at import time in 1.5.1 see #5640 also see #5836 for users whishing to remove it again. Are you using an older version of matplotlib?

  10. RichardoC commented on Apr 12, 2016

    Just updated and the warning is now showing up. It's a nice feature to have.

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL