在Mac OSX 10.9中通过自制软件安装numpy时出错

时间:2014-03-25 12:55:00

标签: python macos numpy pip virtualenv

通过自制软件安装numpy时出现以下错误:

$ pip install numpy


  File "numpy/core/setup.py", line 42, in check_types

    out = check_types(*a, **kw)

  File "numpy/core/setup.py", line 288, in check_types

    "Cannot compile 'Python.h'. Perhaps you need to "\

SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.

我没有找到任何有效的解决方案。 我已经安装了XCode,python 2.7.6(通过自制程序)。布鲁医生说一切都好。

1 个答案:

答案 0 :(得分:3)

我通过以下方式卸载python:

brew uninstall python

重新安装python:

brew install python

和setuptools和pip:

pip install --upgrade setuptools
pip install --upgrade pip

现在,

pip install numpy

成功安装