安装scikit映像时出现问题,可能是由于blosc

时间:2020-05-13 14:55:44

标签: python installation scikit-image

嗨,我正在尝试在ubuntu 18.04的虚拟环境中安装scikit映像。

尝试安装图像编解码器时失败,我尝试单独安装图像编解码器,但由于blosc而导致相同的错误。我单独安装了blosc,但是以某种方式仍然失败。

    /usr/include/python3.6m/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     #warning "Using deprecated NumPy API, disable it by " \
      ^~~~~~~
    imagecodecs/_blosc.c:602:10: fatal error: blosc.h: No such file or directory
     #include "blosc.h"
              ^~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/home/xxxx/im_an/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ijwkwo7f/imagecodecs/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-4xtori6c-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/xxxx/im_an/include/site/python3.6/imagecodecs" failed with error code 1 in /tmp/pip-build-ijwkwo7f/imagecodecs/

我希望有人可以帮助我。谢谢

4 个答案:

答案 0 :(得分:4)

不幸的是,图像编解码器转盘(预编译的二进制文件)仅与pip 19.0及更高版本兼容,因为它们使用了较新的manylinux2010 standard。升级点(pip install -U pip,然后重试,一切正常!

请参阅以下问题以供参考:

https://github.com/scikit-image/scikit-image/issues/4673

https://github.com/scikit-image/scikit-image/issues/4674

答案 1 :(得分:2)

经过一段时间的努力,我用以下方法解决了这个问题:

MouseDown

答案 2 :(得分:1)

安装中缺少开发库(包括* h的开发库)。您可以像这样安装它们:

sudo apt-get install libblosc-dev

您也会遇到其他库的问题:

sudo apt-get install libbrotli-dev

答案 3 :(得分:0)

发生这种情况是因为imagecodecs软件包依赖于计算机所没有的太多依赖项,例如@ user6131524所说的libblosc和libbrotli。

要安装依赖项:

 sudo apt-get install build-essential python3-dev cython3 python3-setuptools python3-pip python3-wheel python3-numpy python3-pytest python3-blosc python3-brotli python3-snappy python3-lz4 libz-dev libblosc-dev liblzma-dev liblz4-dev libzstd-dev libpng-dev libwebp-dev libbz2-dev libopenjp2-7-dev libjpeg-turbo8-dev libjxr-dev liblcms2-dev libcharls-dev libaec-dev libbrotli-dev libsnappy-dev libzopfli-dev libgif-dev libtiff-dev

我相信这将以最一般的方式解决您的问题。