【问题标题】:error when installing package tables for python为python安装包表时出错
【发布时间】:2023-03-12 00:05:02
【问题描述】:

这是我尝试为 python 构建包 tables-3.1.1 时的问题:

sudo python setup.py build_ext --inplace
dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
* Using Python 2.7.2 (default, Oct 11 2012, 20:14:37) 
* Found numpy 1.6.1 package installed.
* Found numexpr 2.4 package installed.
* Found Cython 0.20.2 package installed.
* Found HDF5 headers at ``/usr/local/include``, library at ``/usr/local/lib``.
* Found LZO 2 headers at ``/usr/local/include``, library at ``/usr/local/lib``.
* Skipping detection of LZO 1 since LZO 2 has already been found.
* Found bzip2 headers at ``/usr/local/include``, library at ``/usr/lib``.
/tmp/blosc_list_compressors0xPbk3.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main (int argc, char **argv) {
^~~~
/tmp/blosc_list_compressors0xPbk3.c:2:5: warning: implicit declaration of function 'blosc_list_compressors' is invalid in C99 [-Wimplicit-function-declaration]
    blosc_list_compressors();
    ^
2 warnings generated.
ld: library not found for -lblosc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: library not found for -lblosc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
* Could not find blosc headers and library; using internal sources.
Setting compiler flag '-msse2'
running build_ext

我知道它找不到 blosc 库。我尝试在 python 中导入 blosc:

>>> import blosc
>>> help(blosc)

        ------
        TypeError
            If packed_array is not of type bytes or string.

        Examples
        --------

        >>> import numpy
        >>> a = numpy.arange(1e6)
        >>> parray = blosc.pack_array(a)
        >>> len(parray) < a.size*a.itemsize
        True
        >>> a2 = blosc.unpack_array(parray)
        >>> numpy.alltrue(a == a2)
        True

DATA
    __all__ = ['compress', 'compress_ptr', 'decompress', 'decompress_ptr',...
    __version__ = '1.2.4'

VERSION
    1.2.4

所以,python 可以找到 blosc 包。有人可以帮我解决安装包表的问题吗? 先谢谢了。

【问题讨论】:

    标签: python installation package


    【解决方案1】:

    您需要安装 blosc 开发库。如果您正在运行 CentOS 或 Fedora,请尝试 sudo yum install blosc-devel。对于 Ubuntu,我找不到类似的包,这意味着您可能必须从源代码构建。 There are tarballs here,你必须关注their build instructions

    【讨论】:

    • 我正在使用 Mac OS X 10.8。它给了command not found 百胜。我尝试了 pip,它回复了Could not find any downloads that satisfy the requirement blosc-devel。在 Google 上搜索没有给我任何blosc-devel 的结果。
    • @anders:根据您的建议,我安装了 bcolz 然后再次成功安装了表。但是,import tables 给出错误ImportError: dlopen(/Library/Python/2.7/site-packages/tables/utilsextension.so, 2): Symbol not found: _H5E_CALLBACK_g。我查看安装说明并看到警告:Could not find the HDF5 runtime.The HDF5 shared library was *not* found in the default library paths.Could not find the LZO 2 runtime. The LZO 2 shared library was *not* found in the default library paths.ld: library not found for -lblosc. * Could not find blosc headers and library
    • 当您遇到此类问题时,Google 就是您的朋友。 build 命令告诉您的是它具有未满足的依赖项。在这种情况下,它看起来像 HDF5 和 LZ0 2。我搜索了“HDF5 os x”并找到了this link。尝试通过 homebrew 安装这些命令。
    • 对于 LZO 2,here are some instructions。同样,我所做的只是谷歌“LZO 2 os x”。您可能会遇到一些与路径相关的问题,其中有一个solution/workaround here(查看对python setup.py 的调用以及他如何手动指定库位置)。
    猜你喜欢
    • 2013-08-01
    • 1970-01-01
    • 2023-04-11
    • 1970-01-01
    • 1970-01-01
    • 2022-10-26
    • 2018-08-17
    • 2018-11-11
    • 2023-02-26
    相关资源
    最近更新 更多