ImportError: No module named impyla
ImportError: No module named impyla
我已经按照 this 指南安装了 impyla 及其依赖项。安装似乎成功了,因为现在我可以在 Anaconda 文件夹(64 位 Anaconda 4.1.1版本)。
但是当我在 python 中导入 impyla 时,出现以下错误:
>>> import impyla
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named impyla
我安装了64位Python2.7.12
任何人都可以解释我为什么会遇到这个错误吗?我是 Python 的新手,并且一直在不同的博客上花费大量时间,但我目前还没有看到太多信息。提前感谢您的宝贵时间。
用法与您提到的有点不同(来自 https://github.com/cloudera/impyla)
Impyla 实现了 Python DB API v2.0 (PEP 249) 数据库接口(API 详情请参阅):
from impala.dbapi import connect
conn = connect(host='my.host.com', port=21050)
cursor = conn.cursor()
cursor.execute('SELECT * FROM mytable LIMIT 100')
print cursor.description # prints the result set's schema
results = cursor.fetchall()
Cursor 对象还公开了迭代器接口,它是缓冲的(由 cursor.arraysize 控制):
cursor.execute('SELECT * FROM mytable LIMIT 100')
for row in cursor:
process(row)
您还可以取回一个 pandas DataFrame 对象
from impala.util import as_pandas
df = as_pandas(cur)
# carry df through scikit-learn, for example
我已经按照 this 指南安装了 impyla 及其依赖项。安装似乎成功了,因为现在我可以在 Anaconda 文件夹(64 位 Anaconda 4.1.1版本)。
但是当我在 python 中导入 impyla 时,出现以下错误:
>>> import impyla
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named impyla
我安装了64位Python2.7.12
任何人都可以解释我为什么会遇到这个错误吗?我是 Python 的新手,并且一直在不同的博客上花费大量时间,但我目前还没有看到太多信息。提前感谢您的宝贵时间。
用法与您提到的有点不同(来自 https://github.com/cloudera/impyla)
Impyla 实现了 Python DB API v2.0 (PEP 249) 数据库接口(API 详情请参阅):
from impala.dbapi import connect
conn = connect(host='my.host.com', port=21050)
cursor = conn.cursor()
cursor.execute('SELECT * FROM mytable LIMIT 100')
print cursor.description # prints the result set's schema
results = cursor.fetchall()
Cursor 对象还公开了迭代器接口,它是缓冲的(由 cursor.arraysize 控制):
cursor.execute('SELECT * FROM mytable LIMIT 100')
for row in cursor:
process(row)
您还可以取回一个 pandas DataFrame 对象
from impala.util import as_pandas
df = as_pandas(cur)
# carry df through scikit-learn, for example