2013-10-28 44 views
2

試圖本地建立GeoDjango內置,但得到一個錯誤:Brewed Python cannot import numpy安裝GDAL本地:不能導入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本地工作!

回答

0

檢查哪個Python實際上被調用。您可能正在使用一個Python手動檢查'import numpy',但另一個在brew安裝過程中被調用。

試着改變路徑,以包含在前面的/ usr/bin中,像這樣:

PATH =的/ usr/bin中:$ PATH

我在做這個,做一箇中間很升級到Python 2.7.5,將重新檢查以查看'brew install gdal'是否從中受益。