camelot icon indicating copy to clipboard operation
camelot copied to clipboard

Error in Ubuntu 20.04 (libgs.so: undefined symbol: FT_Set_MM_WeightVector)

Open arcruz0 opened this issue 4 years ago • 3 comments

Hi, thanks for the great library. I recently updated to Ubuntu 20.04 (Pop!_OS 20.04, to be precise) and can't use camelot anymore. I receive the following error when running camelot.read_pdf():

OSError                                   Traceback (most recent call last)
~/anaconda3/lib/python3.7/site-packages/camelot/ext/ghostscript/_gsprint.py in <module>
    259     try:
--> 260         libgs = cdll.LoadLibrary("libgs.so")
    261     except OSError:

~/anaconda3/lib/python3.7/ctypes/__init__.py in LoadLibrary(self, name)
    441     def LoadLibrary(self, name):
--> 442         return self._dlltype(name)
    443 

~/anaconda3/lib/python3.7/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    363         if handle is None:
--> 364             self._handle = _dlopen(self._name, mode)
    365         else:

OSError: /lib/x86_64-linux-gnu/libgs.so: undefined symbol: FT_Set_MM_WeightVector

Here's my GhostScript version:

ghostscript -v
GPL Ghostscript 9.50 (2019-10-15)
Copyright (C) 2019 Artifex Software, Inc.  All rights reserved.

I found someone experiencing the same issue on StackOverflow, but that didn't get solved.

By the way, I can use the CLI version, other than the plotting functions (which I guess invoke the Python library?)

Please let me know if I can provide any additional details, thanks.

arcruz0 avatar Jun 12 '20 15:06 arcruz0

I have the same problem. Please help!

dvivasz avatar Jul 14 '20 21:07 dvivasz

I'm not able to reproduce this issue right now as I don't have a box with Ubuntu 20.04. Let me try and see if it can be reproduced inside a docker container somehow. Can you try downgrading your ghostscript version (9.26 has been known to work) somehow? (I know that might be difficult on Ubuntu) Ghostscript has been a pain, I'm actively trying to look into possible ways to remove it.

vinayak-mehta avatar Sep 10 '20 23:09 vinayak-mehta

I attempted to deploy camelot 0.11.0 inside an Ubuntu 20.04 (default python is 3.8) Docker container using the following Dockerfile after being unsuccessful with Ubuntu 22.04 (speculation: unsupported python 3 version):

FROM docker.io/ubuntu:20.04

ENV LANG=C.UTF-8
ENV TZ=Etc/UTC

ARG DEBIAN_FRONTEND=noninteractive
ARG DEPS_APT="ghostscript python3-tk python3 python3-pip python3-dev"
RUN apt-get update && \
    apt-get install -y $DEPS_APT && \
    apt-get clean

RUN python3 -m pip install "camelot-py[base]"

Upon attempting to import camelot I received errors about missing dependencies:

ImportError: libGL.so.1: cannot open shared object file: No such file or directory
...
ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory

Which were resolved by installing the following packages apt-get install libgl1 libglib2.0-0

After that, appears to work!

qhaas avatar Jul 24 '23 00:07 qhaas