简体   繁体   English

安装Anaconda后无法导入numpy

[英]Can't import numpy after Anaconda installed

I just installed Anaconda 3.5. 我刚刚安装了Anaconda 3.5。 Terminal shows the correct version, and even has Continuum Analytics in brackets: 终端显示正确的版本,甚至在括号中包含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.

However, when I type the following: 但是,当我键入以下内容时:

>>> import numpy

I get the error: 我收到错误:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'numpy'

I know that Anaconda comes with numpy (I ran conda list , just to make sure). 我知道Anaconda附带了numpy(为了确定,我运行了conda list )。 Anyone know what's going on? 有人知道发生了什么吗?

It seems possible that my .bash_profile has something to do with it. 我的.bash_profile似乎与它有关。 If so, the contents follow. 如果是这样,则遵循内容。

# 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

I ended up uninstalling Anaconda and all versions of Python 3. After reinstalling Anaconda, numpy was available. 我最终卸载了Anaconda和所有版本的Python3。重新安装Anaconda之后,可以使用numpy Interestingly enough, on the version that works, Terminal shows the following information: 有趣的是,在可用的版本上,终端显示以下信息:

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.

So apparently seeing "Continuum Analytics" does not mean that you're using Anaconda. 因此很明显看到“连续分析” 并不意味着你使用的蟒蛇。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM