如何在Windows 10上安装snappy C库以与Anaconda中的python-snappy配合使用? [英] How to install snappy C libraries on Windows 10 for use with python-snappy in Anaconda?
问题描述
我想在Windows 10的Anaconda 2安装中使用pip安装用于python的拼花.
I want to install parquet for python using pip within an Anaconda 2 installation on Windows 10.
While installing I ran into the error that is described here, the installer can't find snappy-c.h
.
答案中没有提及如何在Windows上安装它.
There is no mention on how to install this on Windows in the answers.
我从 http://google.github.io/snappy/下载了Snappy库,现在我被卡住了.
I downloaded the Snappy library from http://google.github.io/snappy/ and now I'm stuck.
从我的错误消息中,我本以为头文件需要放在C:\Users\...\AppData\Local\Continuum\Anaconda2\include
中,但是在经过低调的归档文件中,头文件和库文件都位于同一文件夹中.
From my error message I would have assumed that the header files need to be in C:\Users\...\AppData\Local\Continuum\Anaconda2\include
, but in the downlaoded archive header and library files are just all in the same folder.
如何将它们正确安装在Anaconda文件夹中?
How do I install these properly in the Anaconda folder?
完整错误消息:
Building wheels for collected packages: python-snappy
Running setup.py bdist_wheel for python-snappy ... error
Complete output from command C:\Users\...\AppData\Local\Continuum\Anaconda2\python.exe -u -c "import setup
tools, tokenize;__file__='c:\\users\\...\\appdata\\local\\temp\\pip-build-kl4zef\\python-snappy\\setup.py';f=ge
tattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec
'))" bdist_wheel -d c:\users\...\appdata\local\temp\tmpt8fz9bpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-2.7
copying snappy.py -> build\lib.win-amd64-2.7
running build_ext
building '_snappy' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
C:\Users\...\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nol
ogo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Users\...\AppData\Local\Continuum\Anaconda2\include -IC:\Users\...
\AppData\Local\Continuum\Anaconda2\PC /Tpsnappymodule.cc /Fobuild\temp.win-amd64-2.7\Release\snappymodule.obj
snappymodule.cc
snappymodule.cc(31) : fatal error C1083: Cannot open include file: 'snappy-c.h': No such file or directory
error: command 'C:\\Users\\...\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\V
C\\Bin\\amd64\\cl.exe' failed with exit status 2
推荐答案
经过漫长而令人沮丧的时间,尝试使用各种方法使C文件正常工作后,我找到了这个网站:
After a really long and frustrating time trying different methods to get the C files working, I found this site:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
C.Gohlke在哪里为Windows用户编译并上传了文件.
Where C. Gohlke has kindly compiled and uploaded the files for us windows users.
只需根据您的系统和python版本下载所需的版本.我使用的是64位和python 3.6,因此我从下载文件夹中使用了以下命令:
Just download the version you need based on your system and python version. I am using 64bits and python 3.6, so I used the following command from my download folder:
pip install python_snappy-0.5-cp36-cp36m-win_amd64.whl
它就像一种魅力:)
这篇关于如何在Windows 10上安装snappy C库以与Anaconda中的python-snappy配合使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!