加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

python – 安装Anaconda后无法导入numpy

发布时间:2020-12-16 22:53:46 所属栏目:Python 来源:网络整理
导读:我刚刚安装了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 darwinType "help","copyright","credits" or "license

我刚刚安装了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 "

我知道Anaconda带有numpy(我运行conda列表,只是为了确保).有谁知道发生了什么?

我的.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和所有版本的Python 3.重新安装Anaconda后,numpy可用.有趣的是,在有效版本上,终端显示以下信息:

Python 3.5.0 |Anaconda 2.4.0 (x86_64)| (default,"credits" or "license" for more information.

因此,显然看到“Continuum Analytics”并不意味着你正在使用Anaconda.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读