2

尝试在本地设置 geodjango,但出现错误:Brewed Python cannot import numpy

但我可以在解释器中导入 numpy:

Python 2.7.5 (default, Oct 27 2013, 12:25:46) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.__version__
'1.7.1'

为什么我不能brew install gdal

admins-macbook:lib Admin$ brew install gdal
gdal: Unsatisfied dependency: numpy
Brewed Python cannot `import numpy`. Install with:
  pip-2.7 install numpy
Error: An unsatisfied requirement failed this build.

admins-macbook:lib Admin$ pip-2.7 install numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in ./python2.7/site-packages
Cleaning up...

感谢您提供任何可能帮助我让 geodjango 在本地工作的想法!

4

1 回答 1

0

检查实际调用的是哪个 Python。您可能正在使用一个 Python 手动检查“import numpy”,但另一个在 brew 安装期间被调用。

尝试更改路径以在前面包含 /usr/bin,如下所示:

PATH=/usr/bin:$PATH

我正在执行此操作并升级到 Python 2.7.5,将再次检查“brew install gdal”是否从中受益。

于 2013-11-04T08:14:23.150 回答