导入已安装模块的Python错误

时间:2015-12-24 03:19:43

标签: python module

我在Python成功安装模块时遇到错误,但没有加载它。

目前我在Windows 7的Juptyer笔记本中使用Python 3.5.1,Anaconda 2.4.1(64位)。

我成功完成了pip install quandl。如果我再次运行它,我会得到

> Requirement already satisfied (use --upgrade to upgrade): quandl in
> c:\users\crushee\anaconda3\lib\site-packages

此外,当我运行pip freeze

时,会列出quandl模块

当我在笔记本中并运行sys.path时,它也会返回相同的安装目录。我还将此目录添加到Windows

中的PYTHONPATH系统变量中
> ['',  'C:\\Users\\crushee\\Anaconda3\\Lib', 
> 'c:\\users\\crushee\\anaconda3\\lib\\site-packages\\setuptools-19.1.1-py3.5.egg',
> 'C:\\Users\\crushee\\Anaconda3\\Lib\\site-packages\\

但是,当我尝试import quandl时,它会返回错误

ImportError                               Traceback (most recent call last)
<ipython-input-5-ab7fa5ad38a5> in <module>()
----> 1 import quandl

ImportError: No module named 'quandl'

最后,如果我尝试以详细模式导入它,那么这是输出

Traceback (most recent call last): 
File "<stdin>", line 1, in <module> 
File "<frozen importlib._bootstrap>", line 969, in > _find_and_load 
File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked   ImportError: No module name 'quandl'

非常感谢任何帮助

1 个答案:

答案 0 :(得分:0)

尝试:

import Quandl

您可能会遇到其他软件包的其他导入错误(例如我遇到pandas的导入错误。所以,安装pandas)。它在Quandl中以/usr/local/lib/<python>/dist-packages安装。

相关问题