尝试使用pip安装matplotlib和numpy时出错

时间:2014-01-17 19:10:55

标签: python numpy matplotlib

我有python版本3.3。我确实安装了pip,现在尝试安装matplotlib和numpy。

pip install matplotlib
pip install numpy

我收到这些错误:

File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/distutils/sysconfig.py", line 191, in customize_compiler

    _osx_support.customize_compiler(_config_vars)

  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/_osx_support.py", line 418, in customize_compiler

    _find_appropriate_compiler(_config_vars)

  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/_osx_support.py", line 191, in _find_appropriate_compiler

    "Cannot locate working compiler")

SystemError: Cannot locate working compiler

----------------------------------------
Cleaning up...
  Removing temporary dir /private/var/folders/fz/4bjb8_8x4rs_8r97vrh92_mh0000gn/T/pip_build_ayseburcuozdal...
Command python setup.py egg_info failed with error code 1 in /private/var/folders/fz/4bjb8_8x4rs_8r97vrh92_mh0000gn/T/pip_build_ayseburcuozdal/numpy
Exception information:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pip-1.5-py3.3.egg/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pip-1.5-py3.3.egg/pip/commands/install.py", line 270, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pip-1.5-py3.3.egg/pip/req.py", line 1206, in prepare_files
    req_to_install.run_egg_info()
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pip-1.5-py3.3.egg/pip/req.py", line 312, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pip-1.5-py3.3.egg/pip/util.py", line 696, in call_subprocess
    % (command_desc, proc.returncode, cwd))

3 个答案:

答案 0 :(得分:2)

Numpy需要C编译器才能安装。此错误消息向我建议您没有安装C编译器或pip无法找到它。

或者,如果您没有可用的编译器,则可以为numpy获取二进制文件。有关更多安装信息,请访问numpy网站:http://docs.scipy.org/doc/numpy/user/install.html

答案 1 :(得分:0)

我发现了一个简单的问题 出口CC = gcc 解决了我的问题。 (已安装Xcode的OSX但错误相同)

答案 2 :(得分:0)

这对我有用(OSX 10.8.5)

安装Xcode(来自App商店)

启动Xcode

在其首选项中,下载,选择命令行工具等待其安装

你可以退出Xcode

在终端:

CC = GCC

pip3安装matplotlib

pip3安装六个

我最近运行了python 3.4 我必须在matplotlib上获得六个才能让pyplot正常运行