Skip to content

Latest commit

 

History

History
executable file
·
67 lines (41 loc) · 2.23 KB

install-deps.rst

File metadata and controls

executable file
·
67 lines (41 loc) · 2.23 KB

Installation of dependencies

Note

as of v1.0.0 ghostscript is replaced by pdfium as the default image conversion backend. This should make the library easier to install with just a pip install (on linux). The other image conversion backends can still be used and are now optional to install.

The optional dependency Ghostscript can be installed using your system's package manager or by running their installer.

OS-specific instructions

Ubuntu

$ apt install ghostscript

MacOS

$ brew install ghostscript

Note

You might encounter the problem that the ghostscript module cannot be found. This can be fixed with the following commands.

mkdir -p ~/lib

ln -s "$(brew --prefix gs)/lib/libgs.dylib" ~/lib

Windows

For Ghostscript, you can get the installer at their downloads page. And for Tkinter, you can download the ActiveTcl Community Edition from ActiveState.

Checks to see if dependencies are installed correctly

You can run the following checks to see if the dependencies were installed correctly.

For Ghostscript

Open the Python REPL and run the following:

For Ubuntu/MacOS

>>> from ctypes.util import find_library
>>> find_library("gs")
"libgs.so.9"

For Windows

>>> import ctypes
>>> from ctypes.util import find_library
>>> find_library("".join(("gsdll", str(ctypes.sizeof(ctypes.c_voidp) * 8), ".dll")))
<name-of-ghostscript-library-on-windows>

Check: The output of the find_library function should not be empty.

If the output is empty, then it's possible that the Ghostscript library is not available one of the LD_LIBRARY_PATH/DYLD_LIBRARY_PATH/PATH variables depending on your operating system. In this case, you may have to modify one of those path variables.