使用'pip'更新'matplotlib'(1.4.1,在Yosemite更新之后)失败

时间:2014-10-19 15:15:18

标签: python matplotlib pip osx-yosemite

尝试将matplotlib更新为1.4.1(从1.4.0开始)fails with

[...]
OPTIONAL LATEX DEPENDENCIES

                dvipng: yes [version 1.14]

           ghostscript: no

                 latex: yes [version 3.14159265]

               pdftops: no



============================================================================

                        * The following required packages can not be built:

                        * freetype

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /private/tmp/pip_build_root/matplotlib
Storing debug log for failure in /Users/Rax/Library/Logs/pip.log

并记录详细信息

Exception information:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/Library/Python/2.7/site-packages/pip/req.py", line 1229, in prepare_files
    req_to_install.run_egg_info()
  File "/Library/Python/2.7/site-packages/pip/req.py", line 325, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/Library/Python/2.7/site-packages/pip/util.py", line 697, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /private/tmp/pip_build_root/matplotlib

这是否与我最近对优胜美地(来自小牛队)的更新有关;或者它与recent changes似乎是针对matplotlib的{​​{1}}依赖关系 - 还是两者兼而有之?如果是这样,我该怎么做才能解决它?


更新:与1.4.2相同的问题。

1 个答案:

答案 0 :(得分:0)

我在OSX 10.10阅读https://github.com/matplotlib/matplotlib/pull/3713时安装了matplotlib 这不是pip用户的解决方案;只是一种在我的mac上安装matplotlib等待修复的方法。

我下载了matplotlib 1.4.2的来源,
https://github.com/matplotlib/matplotlib/pull/3713/files中所述,在setupext.py中更改了第960行:

'freetype2', 'ft2build.h',

becames

'freetype2', 'freetype2/ft2build.h'

然后编译并安装:

python setup.py build
python setup.py install