问题描述
我已在EC2服务器中安装了以下模块,该服务器已经具有python(3.6)&安装了anaconda:
I have installed installed the following modules in my EC2 server which already has python (3.6) & anaconda installed :
- 贪婪
- 金字塔
- s3fs
- fastparquet
除了fastparquet以外,其他所有东西都可以导入.当我尝试导入fastparquet时,它将引发以下错误:
except fastparquet everything else works on importing. When I try to import fastparquet it throws the following error :
[username@ip8 ~]$ conda -V
conda 4.2.13
[username@ip-~]$ python
Python 3.6.0 |Anaconda custom (64-bit)| (default, Dec 23 2016, 12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
import fastparquet
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/username/anaconda3/lib/python3.6/site-packages/fastparquet/__init__.py", line 15, in <module>
from .core import read_thrift
File "/home/username/anaconda3/lib/python3.6/site-packages/fastparquet/core.py", line 11, in <module>
from .compression import decompress_data
File "/home/username/anaconda3/lib/python3.6/site-packages/fastparquet/compression.py", line 43, in <module>
compressions['SNAPPY'] = snappy.compress
AttributeError: module 'snappy' has no attribute 'compress'
我该如何解决这个问题?
How do I go about fixing this ?
推荐答案
不幸的是,在python-land中有很多东西叫做"snappy".我相信您输入的可能是错误的,在这种情况下,以下conda命令之一应该可以为您解决此问题:
Unfortunately, there are multiple things in python-land called "snappy". I believe you may have the wrong one, in which case one of the following conda commands should solve this for you:
conda install python-snappy
或
conda install python-snappy -c conda-forge
后者稍晚一些(发布了GIL,该GIL在线程应用程序中可能很重要).
where the latter is slightly more recent (releases the GIL which can be important in threaded applications).
这篇关于在python中导入fastparquet时出现snappy错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!