Python ImportError:没有名为impyla的模块
我已经按照指南安装了impyla及其依赖项。安装似乎很成功,因为现在我可以在Anaconda文件夹(64位Anaconda 4.1.1版本)中看到文件夹“impyla-0.13.8-py2.7.egg” 但当我在python中导入impyla时,会出现以下错误:Python ImportError:没有名为impyla的模块,python,hadoop,thrift,impala,Python,Hadoop,Thrift,Impala,我已经按照指南安装了impyla及其依赖项。安装似乎很成功,因为现在我可以在Anaconda文件夹(64位Anaconda 4.1.1版本)中看到文件夹“impyla-0.13.8-py2.7.egg” 但当我在python中导入impyla时,会出现以下错误: >>> import impyla Traceback (most recent call last): File "<stdin>", line 1, in <module&
>>> import impyla
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named impyla
导入impyla
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
ImportError:没有名为impyla的模块
我已经安装了64位Python 2.7.12
有人能解释一下我为什么会遇到这个错误吗?我是Python新手,一直在不同的博客上花时间,但我还没有看到太多的信息。提前感谢您的时间。用法与您提到的(来自)略有不同 Impyla实现了Python DB API v2.0(PEP 249)数据库接口(有关API的详细信息,请参阅它): Cursor对象还公开了迭代器接口,该接口被缓冲(由Cursor.arraysize控制): 您还可以获取数据帧对象
from impala.util import as_pandas
df = as_pandas(cur)
# carry df through scikit-learn, for example
键入
which python
并告诉我您看到了什么我得到了这个错误:>>>哪个python文件“”,第1行哪个python^syntaxer:无效syntax@Amir他在终端中的意思是键入which python
:)我的错误,我在终端上得到这个,'它'不被识别为内部或外部命令,可操作的程序或批处理文件。可能尝试安装python 32位版本。然后再次尝试使用impyla lib..是的,我知道这一点。这应该可以工作,但首先我有导入的问题:P将很快更新你:)你应该导入黑斑羚!不是英皮拉。impyla是库名,用于pytest用法,例如:py.test--connect impyla噢,你说得太对了。它现在可以工作了,在得到Python2 32位后,我现在可以导入黑斑羚了。谢谢:)我也可以用类似的方式连接到Hive吗?有什么想法吗!是的,我想是的。你也可以试试这些:
cursor.execute('SELECT * FROM mytable LIMIT 100')
for row in cursor:
process(row)
from impala.util import as_pandas
df = as_pandas(cur)
# carry df through scikit-learn, for example