简体   繁体   English

安装 scikit-image 的问题可能是由于 blosc

[英]Problem installing scikit-image probably due to blosc

Hi I am trying to install scikit image in a virtual environment on ubuntu 18.04.您好我正在尝试在 ubuntu 18.04 上的虚拟环境中安装 scikit 映像。

It fails when it tries to install imagecodecs, I tried to install imagecodecs separately but it gives the same error which is something due to blosc.当它尝试安装图像编解码器时失败,我尝试单独安装图像编解码器,但它给出了同样的错误,这是由于 blosc 造成的。 I installed blosc separately but somehow this still fails.我单独安装了 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/

I hope that somebody could help me with this.我希望有人可以帮助我解决这个问题。 Thank you谢谢

Unfortunately imagecodecs wheels (pre-compiled binaries) are compatible only with pip 19.0 and newer, because they use the newer manylinux2010 standard .不幸的是,图像编解码器轮(预编译的二进制文件)仅与 pip 19.0 和更高版本兼容,因为它们使用更新的manylinux2010 标准 Upgrade pip ( pip install -U pip ) and try again, and things should work!升级 pip ( pip install -U pip ) 并重试,一切正常!

See these issues for reference:请参阅这些问题以供参考:

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

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

After struggling for a while, I solved this with:经过一段时间的努力,我解决了这个问题:

pip3 install -U pip

The development libraries (those including *h) are missing from your installation.您的安装中缺少开发库(包括 *h)。 You can install them like:您可以像这样安装它们:

sudo apt-get install libblosc-dev

You will have issues with other libraries as well:您也会遇到其他库的问题:

sudo apt-get install libbrotli-dev

etc.等等

This happens because imagecodecs package relies on too many dependencies that your computer doesn't have, like libblosc and libbrotli as @user6131524 has said.发生这种情况是因为 imagecodecs package 依赖于您的计算机没有的太多依赖项,例如 @user6131524 所说的 libblosc 和 libbrotli。

To install the dependencies:要安装依赖项:

 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

I believe this will solve your problem in the most general way.我相信这将以最一般的方式解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM