No such file or directory “limits.h” when installing Pillow on Alpine Linux

前端 未结 5 1950
故里飘歌
故里飘歌 2021-01-31 01:09

I\'m running alpine-linux on a Raspberry Pi 2. I\'m trying to install Pillow via this command:

pip install pillow

This is the output from the

相关标签:
5条回答
  • 2021-01-31 01:15

    I've found some python packages fail to install via pip install but work if you install the associated alpine linux package. For example pip install uwsgi fails complaining about limits.h, but apk add uwsgi-python works fine. Suggest trying apk add py-pillow instead of pip install pillow.

    0 讨论(0)
  • 2021-01-31 01:16

    limits.h is located in libc-dev:

    apk add libc-dev
    
    0 讨论(0)
  • 2021-01-31 01:21

    @zakaria answer is correct, but if you stumble upon

    fatal error: linux/limits.h: No such file or directory
    

    then you need the package linux-headers (notice the prefix linux before limits.h

    apk add linux-headers
    
    0 讨论(0)
  • 2021-01-31 01:30

    I had very similar problem with installing python library regex in docker pyhton:3.6-alpine image, Alpine linux >= 3.3.

    pip install regex
    

    I had to add gcc and musl-dev packages

    apk --no-cache add gcc musl-dev
    
    0 讨论(0)
  • 2021-01-31 01:37

    Alpine Linux uses musl libc. You probably need to install musl-dev.

    0 讨论(0)
提交回复
热议问题