FT_Get_First_Char: symbol not found on alpine #1071
Replies: 5 comments
-
I've also tried to get tar.gz from PyPi and in I've added also >>> import fitz
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/root/.local/lib/python3.7/site-packages/fitz/__init__.py", line 2, in <module>
from fitz.fitz import *
File "/root/.local/lib/python3.7/site-packages/fitz/fitz.py", line 15, in <module>
from . import _fitz
ImportError: Error relocating /usr/lib/libmupdf.so.0: opj_stream_set_user_data: symbol not found So I've tried to add to
|
Beta Was this translation helpful? Give feedback.
-
Cannot reproduce as I have no alpin Linux. Did you try to install from wheel, and it didn't work? |
Beta Was this translation helpful? Give feedback.
-
the error |
Beta Was this translation helpful? Give feedback.
-
Hi!
ALPINE = DEFAULT + [
"jbig2dec",
"jpeg",
"openjp2",
"harfbuzz",
] In particular the absence of "harfbuzz" library is causing the FT_Get_First_Char error.
LIBRARIES = {
"default": DEFAULT,
"ubuntu": DEFAULT,
"arch": ARCH_LINUX,
"manjaro": ARCH_LINUX,
"artix": ARCH_LINUX,
"opensuse": OPENSUSE,
"fedora": FEDORA,
"alpine": ALPINE,
}
if sys.platform.startswith("linux") or "gnu" in sys.platform:
module = Extension(
"fitz._fitz", # name of the module
["fitz/fitz_wrap.c"], # C source file
include_dirs=[ # we need the path of the MuPDF headers
"/usr/include/mupdf",
"/usr/local/include/mupdf",
"mupdf/thirdparty/freetype/include",
"/usr/include/freetype2",
],
libraries=load_libraries(),
) It would be really appreciated if this setup.py modification could be merged into PyMuPDF.
FROM python:3.7-alpine
RUN apk add --no-cache \
mupdf-dev \
gcc \
musl-dev \
jbig2dec \
openjpeg-dev \
jpeg-dev \
harfbuzz-dev
RUN mkdir -p pymupdf \
&& cd pymupdf \
&& wget https://files.pythonhosted.org/packages/02/5f/ed082e4202b811ae6ba319dba0549f9d5f0c84ed6b54b7657d01bb63cc91/PyMuPDF-1.18.12.tar.gz \
&& tar -zxvf PyMuPDF-1.18.12.tar.gz
COPY setup.py /pymupdf/PyMuPDF-1.18.12
RUN ln -s /usr/lib/libjbig2dec.so.0 /usr/lib/libjbig2dec.so
RUN cd /pymupdf/PyMuPDF-1.18.12 \
&& python setup.py build \
&& pip install --upgrade pip \
&& pip install . --user \
&& cd / \
&& rm -rf pymupdf As I mentioned it would be really great if PyMuPDF setup.py could be modified to support Alpine Linux. |
Beta Was this translation helpful? Give feedback.
-
Hi - thank you very much for this research and solution indeed! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have install
pymudef
on alpine container. I know there was already an issue #391 about installing it. I met similar problems but in the end I successfully installed it in the alphine container.The problem occurred during import of the
fitz
.Describe the bug (mandatory)
During import
fitz
I get:To Reproduce (mandatory)
Expected behavior (optional)
Import
fitz
should be flawlessly.Your configuration (mandatory)
Unfortunately, I'm not experienced with the Linux builds, so maybe something is wrong with the linking.
Beta Was this translation helpful? Give feedback.
All reactions