2015-11-19 116 views
5

我剛剛安裝了Anaconda 3.5。終端顯示正確的版本,甚至有連續分析括號:安裝Anaconda後無法導入numpy

Python 3.5.0 |Continuum Analytics, Inc.| (default, Oct 20 2015, 14:39:26) 
[GCC 4.2.1 (Apple Inc. build 5577)] 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' 

我知道那Anaconda帶有numpy(我跑了conda list,只是爲了確保)。任何人都知道發生了什麼事?

我的.bash_profile似乎有可能與它有關。如果是這樣,內容如下。

# Setting PATH for Python 2.7 
# The orginal version is saved in .bash_profile.pysave 
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}" 
export PATH 

# added by Anaconda3 2.3.0 installer 
export PATH="/Users/username/anaconda/bin:$PATH" 

# Setting PATH for Python 3.5 
# The orginal version is saved in .bash_profile.pysave 
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}" 
export PATH 

回答

3

我結束了卸載蟒蛇和Python 3的所有版本重新安裝蟒蛇後,numpy是可用的。有趣的是,在該作品的版本,終端顯示如下信息:

Python 3.5.0 |Anaconda 2.4.0 (x86_64)| (default, Oct 20 2015, 14:39:26) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 

因此很明顯看到「連續分析」並沒有意味着您使用蟒蛇。