简体   繁体   English

在树莓派上安装 scikit-image 时出现问题

[英]Problem installing scikit-image on raspberry pi

I'm trying to install sci-kit image on my raspberry pi, but I'm running into some problems.我正在尝试在我的树莓派上安装 sci-kit 映像,但遇到了一些问题。 Previously it was giving me the error that the file 'libaec.h' was missing.以前它给了我文件'libaec.h'丢失的错误。 I installed libaec using pip, and then that error was solved.我使用pip安装了libaec,然后那个错误就解决了。 However, now it is giving me the error that 'blosc.h' is missing.但是,现在它给了我“blosc.h”缺失的错误。 I managed to install blosc with pip but the error is still there (only showing the last part of the error message):我设法用 pip 安装了 blosc,但错误仍然存在(仅显示错误消息的最后一部分):

   building 'imagecodecs._blosc' extension
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iimagecodecs -I/usr/include/python3.7m -I/usr/lib/python3/dist-packages/numpy/core/include -c imagecodecs/_blosc.c -o build/temp.linux-armv7l-3.7/imagecodecs/_blosc.o
    In file included from /usr/include/python3.7m/numpy/ndarraytypes.h:1822,
                     from /usr/include/python3.7m/numpy/ndarrayobject.h:12,
                     from /usr/include/python3.7m/numpy/arrayobject.h:4,
                     from imagecodecs/_blosc.c:598:
    /usr/include/python3.7m/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     #warning "Using deprecated NumPy API, disable it with " \
      ^~~~~~~
    imagecodecs/_blosc.c:602:10: fatal error: blosc.h: No such file or directory
     #include "blosc.h"
              ^~~~~~~~~
    compilation terminated.
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-txmkharf/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-record-1ugl_qdj/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-txmkharf/imagecodecs/
pi@raspberrypi:~ $ sudo pip3 install blosc
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: blosc in /usr/local/lib/python3.7/dist-packages (1.9.1)
pi@raspberrypi:~ $ 

Any ideas on how I can fix this?关于如何解决这个问题的任何想法? Is blosc located in the right place? blosc 的位置是否正确? If not, how can I move it to the correct place?如果没有,我怎样才能将它移动到正确的位置?

I ran into the same problem when installing a package that depends on imagecodecs.我在安装依赖于图像编解码器的 package 时遇到了同样的问题。 I was able to solve it by updating pip from version 18 to version 20 using我能够通过使用将 pip 从版本 18 更新到版本 20 来解决它

pip3 install --upgrade pip

Hmmmm.嗯。 There might've been a mixup in packages.包裹中可能有混淆。 Try uninstalling blosc, and then re-installing.尝试卸载 blosc,然后重新安装。 If the problem still persists, then try uninstalling and reinstalling all the packages you installed.如果问题仍然存在,请尝试卸载并重新安装您安装的所有软件包。 The only thing I can think if after that is to use a package installer such as anaconda.如果在那之后我唯一能想到的是使用 package 安装程序,例如 anaconda。 Sometimes, it can perform miracles.有时,它可以创造奇迹。 I hope this helps you.我希望这可以帮助你。

I believe that imagecodecs does not used the installed blosc but instead uses its own version, which is why installing blosc wouldn't help.我相信 imagecodecs使用已安装的 blosc 而是使用它自己的版本,这就是为什么安装 blosc 无济于事。 If you look at the imagecodecs page on PyPI , you can find this help information:如果您查看PyPI 上的 imagecodecs 页面,您可以找到以下帮助信息:

To install the requirements for building imagecodecs from source code on current Debian based Linux distributions, run:要在当前基于 Debian 的 Linux 发行版上安装从源代码构建图像编解码器的要求,请运行:

$ sudo apt-get install build-essential python3-dev cython3 python3-setuptools python3-pip python3-wheel python3-numpy libz-dev libblosc-dev liblzma-dev liblz4-dev libzstd-dev libpng-dev libwebp-dev libbz2-dev libopenjp2-7-dev libjpeg62-turbo-dev libjxr-dev liblcms2-dev libtiff-dev

On the other hand, they also say:另一方面,他们也说:

The imagecodecs package can be challenging to build from source code.从源代码构建图像编解码器 package 可能具有挑战性。

Fingers crossed that those instructions work for you!祈祷这些说明对您有用!

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

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