使用anaconda安装snapy,如何在Windows 10上安装snappy C库以与Anaconda中的python-snappy配合使用?...

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.

There is no mention on how to install this on Windows in the answers.

I downloaded the Snappy library from http://google.github.io/snappy/ and now I'm stuck.

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.

How do I install these properly in the Anaconda folder?

Full error message:

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

解决方案

After a really long and frustrating time trying different methods to get the C files working, I found this site:

Where C. Gohlke has kindly compiled and uploaded the files for us windows users.

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

It worked like a charm :)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值