安装python包表时出错

时间:2014-08-01 22:10:29

标签: python install package

当我尝试为python构建包表-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包。有人可以帮我解决安装包表的问题吗? 谢谢。

1 个答案:

答案 0 :(得分:0)

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