0

我安装了 C-Blosc 库没问题,但是当我尝试安装 python-blosc 并到达时python setup.py build_ext --inplace --blosc="C:\\Program Files (x86)\\blosc"出现链接错误。这是怎么回事?

我有 Windows 7,并试图从这里https://github.com/Blosc在 MSVC 2015 中安装 Python Blosc 。

running build_ext
building 'blosc.blosc_extension' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL 
/DNDEBUG /MD "-IC:\Program Files (x86)\blosc\include" -IC:\Users\adam.hendry\AppData\Local\Programs\Python\Python35\include -IC:\Users\adam.hendry\AppData\Local\Programs\Python\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" /Tcblosc/blosc_extension.c /Fobuild\temp.win-amd64-3.5\Release\blosc/blosc_extension.obj
blosc_extension.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO "/LIBPATH:C:\Program Files (x86)\blosc\lib" /LIBPATH:C:\Users\adam.hendry\AppData\Local\Programs\Python\Python35\libs /LIBPATH:C:\Users\adam.hendry\AppData\Local\Programs\Python\Python35\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\um\x64" blosc.lib /EXPORT:PyInit_blosc_extension build\temp.win-amd64-3.5\Release\blosc/blosc_extension.obj /OUT:build\lib.win-amd64-3.5\blosc\blosc_extension.cp35-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.5\Release\blosc\blosc_extension.cp35-win_amd64.lib
blosc_extension.obj : warning LNK4197: export 'PyInit_blosc_extension' specified multiple times; using first specification
   Creating library build\temp.win-amd64-3.5\Release\blosc\blosc_extension.cp35-win_amd64.lib and 
object build\temp.win-amd64-3.5\Release\blosc\blosc_extension.cp35-win_amd64.exp
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_cbuffer_sizes
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_free_resources
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_cbuffer_complib    
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_destroy
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_get_complib_info
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_compress
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_set_nthreads
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_init
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_get_blocksize
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_compname_to_compcode
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_compress_ctx
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_set_blocksize
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_set_compressor
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_decompress_ctx
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_get_nthreads
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_compcode_to_compname
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_decompress
blosc_extension.obj : error LNK2001: unresolved external symbol blosc_list_compressors
build\lib.win-amd64-3.5\blosc\blosc_extension.cp35-win_amd64.pyd : fatal error LNK1120: 18 
unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' 
failed with exit status 1120
4

1 回答 1

0

这是这里 python-blosc 的维护者。正如评论中提到的那样,做一个pip install blosc将需要一个 c 编译器和 python 开发头文件。之所以如此,是因为 python-blosc 不能作为轮子使用(状态:2019 年 2 月 9 日)。但是,您可以使用conda安装通过 conda-forge 构建的预编译二进制文件:

conda install -c conda-forge python-blosc

于 2019-02-09T16:16:25.200 回答