0

I'm trying to install sci-kit image on my raspberry pi, but I'm running into some problems. Previously it was giving me the error that the file 'libaec.h' was missing. I installed libaec using pip, and then that error was solved. However, now it is giving me the error that 'blosc.h' is missing. I managed to install blosc with pip but the error is still there (only showing the last part of the error message):

   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? If not, how can I move it to the correct place?

3 Answers 3

3

I ran into the same problem when installing a package that depends on imagecodecs. I was able to solve it by updating pip from version 18 to version 20 using

pip3 install --upgrade pip
Sign up to request clarification or add additional context in comments.

1 Comment

Upgrading pip worked for an issue encountered while installing imagecodes on Centos 7
1

I believe that imagecodecs does not used the installed blosc but instead uses its own version, which is why installing blosc wouldn't help. If you look at the imagecodecs page on PyPI, you can find this help information:

To install the requirements for building imagecodecs from source code on current Debian based Linux distributions, run:

$ 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.

Fingers crossed that those instructions work for you!

1 Comment

The latest version requires other libraries, check them out at pypi.org/project/imagecodecs. The link in this answear is for a specific old version.
0

Hmmmm. There might've been a mixup in packages. Try uninstalling blosc, and then re-installing. 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. Sometimes, it can perform miracles! I hope this helps you.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.