How to check that the anaconda package was properly installed(如何检查 anaconda 软件包是否已正确安装)
问题描述
我是 Python 的新手,想用它进行数据分析.我刚刚在运行 OSX 10.8 的 Mac 上安装了 Python 2.7.我需要 NumPy、SciPy、matplotlib 和 csv 包.我读到我可以简单地安装 Anaconda 包并将所有内容合二为一.所以我继续下载/安装 Anaconda 1.7.
I'm completely new to Python and want to use it for data analysis. I just installed Python 2.7 on my mac running OSX 10.8. I need the NumPy, SciPy, matplotlib and csv packages. I read that I could simply install the Anaconda package and get all in one. So I went ahead and downloaded/installed Anaconda 1.7.
但是,当我输入:将 numpy 导入为 np
However, when I type in: import numpy as np
我收到一条错误消息,告诉我没有这样的模块.我认为这与安装位置有关,但我不知道如何:A. 检查一切是否实际安装正确B. 检查安装位置.
I get an error telling me that there is no such module. I assume this has to do with the location of the installation, but I can't figure out how to: A. Check that everything is actually installed properly B. Check the location of the installation.
任何指针将不胜感激!
谢谢
推荐答案
你可以通过在命令行中查看which python的结果来判断你运行的python是哪个版本的错误.很可能您正在运行系统版本(尽管最新版本的 Mac OS X 在其系统 python 中包含 numpy),而不是 Anaconda 的 python 发行版.如果是这种情况,您需要在安装过程结束时按照 Anaconda 的建议修改您的 PATH.假设它安装在 ~/anaconda 中,您需要添加如下内容:
You can determine which version of python you are running when you get the error by looking at the results of which python from the commandline. It is likely that you are running the system version (although recent versions Mac OS X include numpy in its system python), rather than Anaconda's python distribution. If this is the case, you need to modify your PATH as suggested by Anaconda at the end of the install process. Assuming it was installed in ~/anaconda, you would need to add something like:
export PATH=$HOME/anaconda/bin:$PATH
到你的 .bash_profile
这篇关于如何检查 anaconda 软件包是否已正确安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何检查 anaconda 软件包是否已正确安装
基础教程推荐
- 在 Django Admin 中使用内联 OneToOneField 2022-01-01
- Python 中是否有任何支持将长字符串转储为块文字或折叠块的 yaml 库? 2022-01-01
- kivy 应用程序中的一个简单网页作为小部件 2022-01-01
- 在 Python 中将货币解析为数字 2022-01-01
- 对多索引数据帧的列进行排序 2022-01-01
- matplotlib 设置 yaxis 标签大小 2022-01-01
- 比较两个文本文件以找出差异并将它们输出到新的文本文件 2022-01-01
- 究竟什么是“容器"?在蟒蛇?(以及所有的 python 容器类型是什么?) 2022-01-01
- Python,确定字符串是否应转换为 Int 或 Float 2022-01-01
- Kivy 使用 opencv.调整图像大小 2022-01-01
