简体   繁体   English

import matplotlib.pyplot - fc-list挂起

[英]import matplotlib.pyplot - fc-list hangs

I am experiencing the same problem as described in import matplotlib.pyplot hangs after updating my matplotlib version import matplotlib.pyplot as plt hangs while executing fc-list . 我遇到的问题与导入matplotlib.pyplot中描述的相同问题在更新我的matplotlib版本import matplotlib.pyplot as plt挂起, import matplotlib.pyplot as plt在执行fc-list挂起。

However, the proposed solution does not work for me; 但是, 建议的解决方案对我不起作用; running fc-list in ~/.matplotlib takes 100% CPU and does not finish within 15 minutes. ~/.matplotlib运行fc-list需要100%的CPU,并且在15分钟内没有完成。

I have the following configuration: 我有以下配置:

  • Mac, running OS 10.10.5 (OS X Yosemite) Mac,运行OS 10.10.5(OS X约塞米蒂)
  • Python 2.7.5 Python 2.7.5
  • matplotlib 1.4.3 (was 1.3.1, no problems with that version) matplotlib 1.4.3(原为1.3.1,该版本没有问题)

To update my matplotlib version, I used: 要更新我的matplotlib版本,我使用了:

sudo pip install matplotlib

If I re-run this command now, I get 如果我现在重新运行此命令,我会得到

Requirement already satisfied (use --upgrade to upgrade): matplotlib in /Library/Python/2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): pytz in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): pyparsing!=2.0.0,>=1.5.6 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): nose>=0.11.1 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): six>=1.4 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): mock in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): funcsigs in /Library/Python/2.7/site-packages (from mock->matplotlib)
Requirement already satisfied (use --upgrade to upgrade): pbr>=0.11 in /Library/Python/2.7/site-packages (from mock->matplotlib)

and sudo pip install --upgrade matplotlib : sudo pip install --upgrade matplotlib

Requirement already up-to-date: matplotlib in /Library/Python/2.7/site-packages
Requirement already up-to-date: numpy>=1.6 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: pytz in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: pyparsing!=2.0.0,>=1.5.6 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: python-dateutil in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: nose>=0.11.1 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: six>=1.4 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: mock in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: funcsigs in /Library/Python/2.7/site-packages (from mock->matplotlib)
Requirement already up-to-date: pbr>=0.11 in /Library/Python/2.7/site-packages (from mock->matplotlib)

I have a fontList.cache file in ~/.matplotlib . 我在~/.matplotlib有一个fontList.cache文件。 This file is old (dating back to 2013, thus older than this update attempt). 此文件是旧的(可追溯到2013年,因此比此更新尝试更早)。

Questions: 问题:

  1. Despite the fontList.cache file, should I run fc-list , expecting it to finish at some point? 尽管有fontList.cache文件,我应该运行fc-list ,期望它在某个时候完成吗?
  2. Is matplotlib expecting to find the fontList.cache file in a different location? matplotlib是否希望在不同的位置找到fontList.cache文件? Maybe my install/update of matplotlib messed up some path - but: matplotlib.get_cachedir() returns /Users/MyName/.matplotlib 也许我的matplotlib的安装/更新搞砸了一些路径 - 但是: matplotlib.get_cachedir()返回/Users/MyName/.matplotlib
  3. Has the filename changed? 文件名是否已更改? Should I rename fontList.cache ? 我应该重命名fontList.cache吗?
  4. I do not have the /usr/X11/lin directory anymore. 我没有/usr/X11/lin目录了。 However, could fc-list still enter an infinite loop as suggested ? 但是, fc-list仍然可以按照建议进入无限循环?

I cannot reproduce the problem after posting the question. 发布问题后我无法重现问题。


I suspect that (re-)running 我怀疑(重新)跑步

sudo pip install matplotlib

and/or 和/或

sudo pip install --upgrade matplotlib

while writing the question (to capture the on-screen output) fixed the previously existing issue. 在编写问题(捕获屏幕输出)时修复了以前存在的问题。

fc-list now finished within 2 minutes; fc-list现在在2分钟内完成; hough it did not create a new fontList.cache file. 虽然它没有创建一个新的fontList.cache文件。


I can now call import matplotlib.pyplot as plt as before. 我现在可以像以前import matplotlib.pyplot as plt调用import matplotlib.pyplot as plt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM