2

我尝试安装 PyTables 模块。我使用 Windows 7 (x32)、Python 2.7.3 (x32)、Cython 0.16、Visual Studio 2008 (9.0)。在 cmd.exe '以管理员身份运行' 写入:'python setup.py install --hdf5="C:\Program Files\HDF Group\HDF5\1.8.9"'。

但是有未解析的外部符号并且构建失败:

* Found numpy 1.6.2 package installed.
* Found numexpr 2.0.1 package installed.
* Found Cython 0.16 package installed.
* Found HDF5 headers at ``C:\Program Files\HDF Group\HDF5\1.8.9\include``, libra
ry at ``C:\Program Files\HDF Group\HDF5\1.8.9\lib``.
* Could not find LZO 2 headers and library; disabling support for it.
* Could not find LZO 1 headers and library; disabling support for it.
* Could not find bzip2 headers and library; disabling support for it.
cythoning tables\linkExtension.pyx to tables\linkExtension.c
running install
running build
running build_py
running build_ext
No module named msvccompiler in numpy.distutils; trying from distutils
building 'tables.utilsExtension' extension
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W
3 /GS- /DNDEBUG -DNDEBUG=1 -DWIN32=1 -D_HDF5USEDLL_=1 -Iblosc -IC:\Python27\lib\
site-packages\numpy-1.6.2-py2.7-win32.egg\numpy\core\include -I"C:\Program Files
\HDF Group\HDF5\1.8.9\include" -IC:\Python27\include -IC:\Python27\PC /Tctables\
utilsExtension.c /Fobuild\temp.win32-2.7\Release\tables\utilsExtension.obj -Isrc
 -DH5_USE_16_API
Found executable C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe
utilsExtension.c
c:\program files\hdf group\hdf5\1.8.9\include\H5public.h(47) : fatal error C1083
: Не удается открыть файл include: stdint.h: No such file or directory
error: Command "C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /n
ologo /Ox /MD /W3 /GS- /DNDEBUG -DNDEBUG=1 -DWIN32=1 -D_HDF5USEDLL_=1 -Iblosc -I
C:\Python27\lib\site-packages\numpy-1.6.2-py2.7-win32.egg\numpy\core\include -I"
C:\Program Files\HDF Group\HDF5\1.8.9\include" -IC:\Python27\include -IC:\Python
27\PC /Tctables\utilsExtension.c /Fobuild\temp.win32-2.7\Release\tables\utilsExt
ension.obj -Isrc -DH5_USE_16_API" failed with exit status 2
4

2 回答 2

9

在 Windows 上从源代码安装带有 C 扩展的 Python 包很困难。幸运的是,有人构建这些工具包并提供它们:http ://www.lfd.uci.edu/~gohlke/pythonlibs/#pytables

从二进制工具包安装它,你会更开心。

于 2012-07-15T14:09:50.010 回答
0

可能重复:pytables 安装失败

看看这个答案: https ://stackoverflow.com/a/68740234/11236901

或者只是为您的操作系统安装一个稳定版本:http ://www.lfd.uci.edu/~gohlke/pythonlibs/#pytables

并将文件安装在您的目录中:

  • pip install C:/some-dir/some-file.whl
于 2021-08-11T10:37:54.330 回答