首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >snappy/snappymodule.cc(31):致命错误C1083:无法打开包含文件:'snappy-c.h':没有这样的文件或目录

snappy/snappymodule.cc(31):致命错误C1083:无法打开包含文件:'snappy-c.h':没有这样的文件或目录
EN

Stack Overflow用户
提问于 2019-08-29 18:37:29
回答 1查看 478关注 0票数 3

我无法安装python-snappy模块。我首先成功地安装了snappy模块,但是在python-snappy中出现了下面的错误。

代码语言:javascript
复制
(new-env) C:\Automation\test-automation\connect>pip install python-snappy
Collecting python-snappy
  Using cached https://files.pythonhosted.org/packages/45/35/65d9f8cc537129894b4b32647d80212d1fa342877581c5b8a69872cea8be/python-snappy-0.5.4.tar.gz
Installing collected packages: python-snappy
  Running setup.py install for python-snappy ... error
    Complete output from command C:\Automation\test-automation\new-env\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\vagrant\\AppData\\Local\\Temp\\
2\\pip-install-17b8xwg1\\python-snappy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))
" install --record C:\Users\vagrant\AppData\Local\Temp\2\pip-record-vdvhb6a5\install-record.txt --single-version-externally-managed --compile --install-headers C:\Automation\tes
t-automation\new-env\include\site\python3.7\python-snappy:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.7
    creating build\lib.win32-3.7\snappy
    copying snappy\hadoop_snappy.py -> build\lib.win32-3.7\snappy
    copying snappy\snappy.py -> build\lib.win32-3.7\snappy
    copying snappy\snappy_cffi.py -> build\lib.win32-3.7\snappy
    copying snappy\snappy_cffi_builder.py -> build\lib.win32-3.7\snappy
    copying snappy\snappy_formats.py -> build\lib.win32-3.7\snappy
    copying snappy\__init__.py -> build\lib.win32-3.7\snappy
    copying snappy\__main__.py -> build\lib.win32-3.7\snappy
    running build_ext
    building 'snappy._snappy' extension
    creating build\temp.win32-3.7
    creating build\temp.win32-3.7\Release
    creating build\temp.win32-3.7\Release\snappy
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Automation\test-automation\new-env\include "-IC:\Program Files (x8
6)\Python37-32\include" "-IC:\Program Files (x86)\Python37-32\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\
10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows
 Kits\8.1\include\winrt" /EHsc /Tpsnappy/snappymodule.cc /Fobuild\temp.win32-3.7\Release\snappy/snappymodule.obj
    snappymodule.cc
    snappy/snappymodule.cc(31): fatal error C1083: Cannot open include file: 'snappy-c.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2
----------------------------------------
Command "C:\Automation\test-automation\new-env\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\vagrant\\AppData\\Local\\Temp\\2\\pip-install-17b8xwg1\
\python-snappy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Us
ers\vagrant\AppData\Local\Temp\2\pip-record-vdvhb6a5\install-record.txt --single-version-externally-managed --compile --install-headers C:\Automation\test-automation\new-env\inc
lude\site\python3.7\python-snappy" failed with error code 1 in C:\Users\vagrant\AppData\Local\Temp\2\pip-install-17b8xwg1\python-snappy\

(new-env) C:\Automation\test-automation\connect>

已成功安装snappy和Visual Studio 14。

EN

回答 1

Stack Overflow用户

发布于 2020-06-24 13:25:17

在这种情况下,您可以下载由C.Gohlke编译的轮子文件。

您所需要做的就是找到您需要的依赖项,然后根据您的python版本在http://www.lfd.uci.edu/~gohlke/pythonlibs/上进行搜索。

下载文件后,转到该文件位置并使用pip简单地安装它。

例如,在本例中,假设您使用的是Python3.7版本,并且您希望安装python-snappy,然后首先下载python_snappy‑0.5.4‑cp37‑cp37m‑win_amd64.whl,然后将其保存到某个位置。再次转到该位置,只需使用pip install python_snappy-0.5.4-cp37-cp37m-win_amd64.whl即可。

就这样。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57708346

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档