[英]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: 我有以下配置:
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: 问题:
fontList.cache
file, should I run fc-list
, expecting it to finish at some point? 尽管有fontList.cache
文件,我应该运行fc-list
,期望它在某个时候完成吗? 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
fontList.cache
? 我应该重命名fontList.cache
吗? /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.