question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Weasyprint startup error after updating to El Capitan (OS X 10.11)

See original GitHub issue

I recently updated my OS on my mac to El Capitan and since then have been running into issues trying to run WeasyPrint. I have updated macports, uninstalled and reinstalled all of the macport dependencies. I’ve also uninstalled and reinstalled WeasyPrint via pip with no issues, but still it doesn’t run. I also have the export DYLD_FALLBACK_LIBRARY_PATH="/opt/local/lib" in my ~/.profile which helped solve the import errors and allowed WeasyPrint to run before I had El Capitan installed. When i type weasyprint --help into the terminal i get the following output/error:

 File "main.py", line 14, in <module>
    import nextline_webapp.quotes                   # pylint: disable=unused-import
  File "/Users/joshsacks/NextLine/nextline_webapp/quotes.py", line 8, in <module>
    from flask_weasyprint import HTML, render_pdf
  File "/Library/Python/2.7/site-packages/flask_weasyprint/__init__.py", line 13, in <module>
    import weasyprint
  File "/Library/Python/2.7/site-packages/weasyprint/__init__.py", line 336, in <module>
    from .css import PARSER, preprocess_stylesheet
  File "/Library/Python/2.7/site-packages/weasyprint/css/__init__.py", line 30, in <module>
    from . import computed_values
  File "/Library/Python/2.7/site-packages/weasyprint/css/computed_values.py", line 18, in <module>
    from .. import text
  File "/Library/Python/2.7/site-packages/weasyprint/text.py", line 18, in <module>
    import cairocffi as cairo
  File "/Library/Python/2.7/site-packages/cairocffi/__init__.py", line 46, in <module>
    cairo = dlopen(ffi, 'cairo', 'cairo-2')
  File "/Library/Python/2.7/site-packages/cairocffi/__init__.py", line 43, in dlopen
    raise OSError("dlopen() failed to load a library: %s" % ' / '.join(names))
OSError: dlopen() failed to load a library: cairo / cairo-2

Thanks

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:24 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
droratacommented, Nov 29, 2016

I also experience the problem on a fresh install of weasyprint on Mac 10.11.6. I use macports thus all the solutions involving brew are not helpful.

I installed sudo port install cairo after pip install weasyprint. I’m using Python 3.5.2

Seems like conda install pango helped.

1reaction
iainctduncancommented, Sep 12, 2016

Same here. Just installed WeasyPrint on an El Capitan install that has not had WeasyPrint on it before or been upgraded from previous OSX installs. Error I get is:

raise OSError(“dlopen() failed to load a library: %s” % ’ / '.join(names)) OSError: dlopen() failed to load a library: cairo / cairo-2

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trouble running WeasyPrint after installing El Capitan (OSX ...
Ok so I found a solution (without changing any of the original weasyprint or cairocffi files). Apparently OS X 10.11 introduces SIP which...
Read more >
Weasyprint startup error after updating to El Capitan (OS X 10.11)
Weasyprint startup error after updating to El Capitan (OS X 10.11)
Read more >
El Capitan won't Boot after update - Apple Support Communities
I installed El Capitan and it was booting fine. Then I installed the latest update and after the restart, the Mac loads the...
Read more >
Running WeasyPrint after updating Mac to El Capitan
I ran into a similar problem and for me it helped to. set my locale in my .zshrc / .bashrc; be sure to...
Read more >
Fix Mac OS X El Capitan will not start up after update
OS X El Capitan is the twelfth major release of OS X for Mac computers. It was released on September 30, 2015. Some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found