import matplotlib.pyplot - fc-list挂起

时间:2015-10-17 17:12:38

标签: python python-2.7 matplotlib osx-yosemite

在执行handle_bar()时更新我的​​matplotlib版本import matplotlib.pyplot as plt后,我遇到与import matplotlib.pyplot hangs中所述相同的问题。

然而,the proposed solution对我不起作用;在fc-list中运行fc-list需要100%的CPU,并且在15分钟内无法完成。

我有以下配置:

  • Mac,运行OS 10.10.5(OS X Yosemite)
  • Python 2.7.5
  • matplotlib 1.4.3(1.3.1,该版本没有问题)

要更新我的matplotlib版本,我使用了:

~/.matplotlib

如果我现在重新运行此命令,我会

sudo pip install matplotlib

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)

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) 中有fontList.cache个文件。此文件是旧的(可追溯到2013年,因此比此更新尝试更早)。

问题:

  1. 尽管有~/.matplotlib文件,我应该运行fontList.cache,期望它在某个时候完成吗?
  2. matplotlib是否希望在其他位置找到fc-list文件?也许我的matplotlib的安装/更新搞砸了一些路径 - 但是:matplotlib.get_cachedir()返回fontList.cache
  3. 文件名是否已更改?我应该重命名/Users/MyName/.matplotlib吗?
  4. 我不再拥有fontList.cache目录了。但是,/usr/X11/lin仍然可以进入无限循环as suggested

1 个答案:

答案 0 :(得分:2)

发布问题后我无法重现问题。

我怀疑(重新)正在运行

sudo pip install matplotlib

和/或

sudo pip install --upgrade matplotlib

在编写问题时(捕获屏幕输出)修复了以前存在的问题。

fc-list现在在2分钟内完成;虽然它没有创建一个新的fontList.cache文件。

我现在可以像以前一样致电import matplotlib.pyplot as plt