WebFaction
Community site: login faq

I am having trouble installing the Weasyprint dependencies (http://weasyprint.readthedocs.io/en/stable/install.html). I found this question/answer but it does not work for me.

I get this error when trying to configure Glib:

checking libmount/libmount.h usability... no
checking libmount/libmount.h presence... no
checking for libmount/libmount.h... no
configure: error: *** Could not find libmount

I did find this post. The symlink is in place. But there is no libmount.h I do not know what package I need to install it.

Also I've tried to change the refence to python to 3.5, as Weasyprint strongly suggests using python 3. But neither 3.5 nor 2.7 work, both giving the same error.

Hoping someone can help me out. Thanks in advance!

asked 17 Jun, 09:15

Etienne's gravatar image

Etienne
133
accept rate: 0%


I was able to get it to install by building cairo from source and letting pip do the rest,

# set the build environment
export TMPDIR="$HOME/tmp"
export PATH="$HOME/bin:$PATH"
export C_INCLUDE_PATH="$HOME/include:$C_INCLUDE_PATH"
export LIBRARY_PATH="$HOME/lib:$LIBRARY_PATH"
export LD_LIBRARY_PATH="$HOME/lib:$LD_LIBRARY_PATH"
export CPPFLAGS="-I$HOME/include $CPPFLAGS"
export LDFLAGS="-L$HOME/lib $LDFLAGS"
export PKG_CONFIG_PATH="$HOME/lib/pkgconfig"

# build cairo 
mkdir $HOME/src
cd $HOME/src
wget 'https://cairographics.org/releases/cairo-1.14.10.tar.xz'
tar -xf cairo-1.14.10.tar.xz
cd cairo-1.14.10
./configure --prefix=$HOME
make    # <-- this takes a while
make install

# install weasyprint
pip3.6 install WeasyPrint

(edit) I also had to build Pango and HarffBuzz and re-install,

cd $HOME/src
wget https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.4.6.tar.bz2
tar -xf harfbuzz-1.4.6.tar.bz2 
cd harfbuzz-1.4.6
./configure --prefix=$HOME
make
make install


cd $HOME/src
wget 'http://ftp.gnome.org/pub/GNOME/sources/pango/1.40/pango-1.40.0.tar.xz'
tar -xJf pango-1.40.0.tar.xz
cd pango-1.40.0
./configure --prefix=$HOME --sysconfdir=$HOME/etc
make    # 22s
make install

pip3.6 install WeasyPrint -I


$ weasyprint 
usage: weasyprint [-h] [--version] [-e ENCODING] [-f {pdf,png}]
                  [-s STYLESHEET] [-m MEDIA_TYPE] [-r RESOLUTION]
                  [--base-url BASE_URL] [-a ATTACHMENT] [-p]
                  input output
weasyprint: error: the following arguments are required: input, output
permanent link

answered 18 Jun, 21:47

johns's gravatar image

johns ♦♦
4.8k29
accept rate: 22%

edited 18 Jun, 22:00

Thanks! This worked for me!

(22 Jun, 19:01) Etienne Etienne's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×3

question asked: 17 Jun, 09:15

question was seen: 244 times

last updated: 22 Jun, 19:01

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM