2016-02-08 90 views
3

我無法通過brew爲python3安裝numpy。OSX通過brew for python3安裝numpy

I型:

brew install numpy --with-python3 

那麼它是python2

Python 2.7.6 (default, Sep 9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import numpy 
>>> 

,但仍確定沒有找到python3

Python 3.4.0 (v3.4.0:04f714765c13, Mar 15 2014, 23:02:41) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import numpy 
Traceback (most recent call last): 
File "<stdin>", line 1, in <module> 
ImportError: No module named 'numpy' 
>>> 

如何使它爲python3工作?

回答

4

安裝它正確的方法是通過:

pip3 install numpy 

顯然,你需要安裝python3和第一支託。我測試和工作沒有任何問題。

+1

謝謝,我知道pip3工作得很好。也許我不太確切,我需要從brew安裝。這是關於特定版本和其他依賴關係。 – speedingdeer

1

自制軟件的問題是它只能看到系統的python和它自己安裝的那個。所以你必須先通過brew安裝python3,然後使用--with-python3選項。