[英]snappy/snappymodule.cc(31): fatal error C1083: Cannot open include file: 'snappy-c.h': No such file or directory
I'm not able to install python-snappy module.我无法安装 python-snappy 模块。 I have successfully installed snappy module first but getting below error for python-snappy.我首先成功安装了 snappy 模块,但在 python-snappy 中出现以下错误。
(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>
Successfully installed snappy and Visual Studio 14.成功安装 snappy 和 Visual Studio 14。
In such cases you can download the wheel files compiled by C. Gohlke.在这种情况下,您可以下载由 C. Gohlke 编译的轮文件。
All you need to do is that find which dependencies you need and then search on the http://www.lfd.uci.edu/~gohlke/pythonlibs/ according to your python version.您需要做的就是找到您需要的依赖项,然后根据您的 Python 版本在http://www.lfd.uci.edu/~gohlke/pythonlibs/上搜索。
After downloading the file, go to that file location and simply install it using pip.下载文件后,转到该文件位置并使用 pip 安装它。
For example in this case lets say you are using python 3.7 version and you want to install python-snappy then first download python_snappy‑0.5.4‑cp37‑cp37m‑win_amd64.whl
and then save it on some location.例如,在这种情况下,假设您使用的是 python 3.7 版本,并且您想安装 python python_snappy‑0.5.4‑cp37‑cp37m‑win_amd64.whl
然后首先下载python_snappy‑0.5.4‑cp37‑cp37m‑win_amd64.whl
,然后将其保存在某个位置。 Again go to that location and simply use pip install python_snappy-0.5.4-cp37-cp37m-win_amd64.whl
.再次转到该位置,只需使用pip install python_snappy-0.5.4-cp37-cp37m-win_amd64.whl
。
That's it.就是这样。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.