python-zstd: Zstd fails to install
Hi. I try to install via pip and get the following error: Visual C++ also installed. Setuptools version: 40.5.0 How should I resolve this issue?
C:\Users\Emil>pip3 install zstd
Collecting zstd
Using cached https://files.pythonhosted.org/packages/08/ea/693d977411af8f9a43aee43a092e8b30542cdb9c5a326739ff844549cf93/zstd-1.3.5.1.tar.gz
Installing collected packages: zstd
Running setup.py install for zstd ... error
Complete output from command c:\users\emil\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Emil\\AppData\\Local\\Temp\\pip-install-drb0myv4\\zstd\\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\Emil\AppData\Local\Temp\pip-record-vef6jxhh\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'zstd' extension
creating build
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\zstd
creating build\temp.win-amd64-3.6\Release\zstd\lib
creating build\temp.win-amd64-3.6\Release\zstd\lib\compress
creating build\temp.win-amd64-3.6\Release\zstd\lib\decompress
creating build\temp.win-amd64-3.6\Release\zstd\lib\common
creating build\temp.win-amd64-3.6\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\emil\appdata\local\programs\python\python36\include -Ic:\users\emil\appdata\local\programs\python\python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\include" /Tczstd/lib/compress/zstd_compress.c /Fobuild\temp.win-amd64-3.6\Release\zstd/lib/compress/zstd_compress.obj /Ox /DVERSION="\"1.3.5.1\"" /Izstd\lib /Izstd\lib\common /Izstd\lib\compress /Izstd\lib\decompress
zstd_compress.c
zstd/lib/compress/zstd_compress.c(14): fatal error C1083: Datei (Include) kann nicht ge”ffnet werden: "string.h": No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\users\emil\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Emil\\AppData\\Local\\Temp\\pip-install-drb0myv4\\zstd\\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\Emil\AppData\Local\Temp\pip-record-vef6jxhh\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Emil\AppData\Local\Temp\pip-install-drb0myv4\zstd\
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 27 (9 by maintainers)
I have encountered the same issue with a conda environment on MacOs Mojave version 10.14.6 with:
gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1 Apple LLVM version 10.0.1 (clang-1001.0.46.4) Target: x86_64-apple-darwin18.7.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
What eventually solved the problem for me was changing the gcc version to a more recent one using:
export CC=/usr/local/Cellar/gcc/9.2.0/bin/gcc-9
export CFLAGS="-Wa,-q"
and then running:
pip install zstd