簡體   English   中英

安裝Anaconda后無法導入numpy

[英]Can't import numpy after Anaconda installed

我剛剛安裝了Anaconda 3.5。 終端顯示正確的版本,甚至在括號中包含Continuum Analytics:

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

我最終卸載了Anaconda和所有版本的Python3。重新安裝Anaconda之后,可以使用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.

因此很明顯看到“連續分析” 並不意味着你使用的蟒蛇。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM