简体   繁体   中英

ERROR: unsatisfiable constraints: libopenjp2-7 (missing): required by: world[libopenjp2-7]

I'm using python:3.7-alpine base image to build a Dockerfile for a Django project.

in the requirement.text file I've WeasyPrint==47

I need libopenjp2-7 package for WeasyPrint becuase I have this error when running Django app.

ImportError: Error loading shared library libopenjp2.so.7: No such file or directory (needed by /code/env/lib/python3.7/site-packages/PIL/_imaging.cpython-37m-x86_64-linux-gnu.so)
Starting server 

This is the dockerfile:

FROM python:3.7-alpine

RUN apk add --no-cache postgresql-dev gettext libxml2-dev libxslt-dev \
    freetype-dev libpng-dev jpeg-dev \
    zlib-dev musl-dev git

RUN pip install --upgrade pip virtualenv==16.7.9

RUN apk add --update gcc \
                    openjpeg \
                    libopenjp2-7 \
                    libffi-dev \
                    cairo-dev \
                    pango-dev \
                    gdk-pixbuf-dev

but when I build it I'm getting this error:

ERROR: unsatisfiable constraints:
  libopenjp2-7 (missing):
    required by: world[libopenjp2-7]

does anyone know what is the issue?

You're probably looking for the openjpeg package.

Remember that different Linux distributions have different names for packages, and they don't necessarily follow a pattern where you can guess a package name from the name of a shared library file. For the case of Alpine, https://pkgs.alpinelinux.org/ has a searchable database of packages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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