如何检查anaconda软件包是否已正确安装 [英] How to check that the anaconda package was properly installed

查看:147
本文介绍了如何检查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软件包是否已正确安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆