GitbookIO / gitbook

The open source frontend for GitBook doc sites
https://www.gitbook.com
GNU General Public License v3.0
26.96k stars 3.85k forks source link

QtCore.so requires version 5.6.0 or later, but QtCore provides version 5.5.0 #2054

Closed etagwerker closed 5 months ago

etagwerker commented 6 years ago

What is the current behavior?

When I run gitbook pdf ./ rails-upgrade.pdf, I get this error:

info: 7 plugins are installed
info: 6 explicitly listed
info: loading plugin "highlight"... OK
info: loading plugin "search"... OK
info: loading plugin "lunr"... OK
info: loading plugin "sharing"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-default"... OK
info: found 10 pages
info: found 1 asset files

EbookError: Error during ebook generation: Conversion options changed from defaults:
  pdf_header_template: u'\n<!DOCTYPE HTML>\n<html lang="" style="font-family: sans-serif; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%;">\n    <head>\n        <meta charset="UTF-8">\n        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">\n        <title>_SECTION_</title>\n        <meta http-equiv="X-UA-Compatible" content="IE=edge">\n        <meta name="description" content="">\n        <meta name="generator" content="GitBook 3.2.3">\n        \n        \n        \n    \n    \n        \n        \n        \n    \n\n    \n            \n        \n\n    \n\n    \n        \n    \n        \n    \n        \n    \n        \n    \n        \n    \n        \n    \n\n        \n    </head>\n    <body style="margin: 0; font-family: sans-serif; color: #000; text-size-adjust: 100%; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">\n        \n<div class="pdf-header" style="margin-top: 20px; padding-bottom: 10px; border-bottom: 1px solid #eee; color: #aaa;">\n    <span>_SECTION_</span>\n</div>\n\n        \n    </body>\n</html>\n\n'
  pdf_page_numbers: True
  level1_toc: u"descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-1 ')]"
  page_breaks_before: u'/'
  margin_top: 56.0
  pdf_default_font_size: 12
  pdf_sans_family: u'Arial'
  level3_toc: u"descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-3 ')]"
  paper_size: u'a4'
  book_producer: u'GitBook'
  publisher: u'GitBook'
  no_chapters_in_toc: True
  margin_bottom: 56.0
  margin_right: 62.0
  max_levels: 1
  pdf_footer_template: u'\n<!DOCTYPE HTML>\n<html lang="" style="font-family: sans-serif; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%;">\n    <head>\n        <meta charset="UTF-8">\n        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">\n        <title>_SECTION_</title>\n        <meta http-equiv="X-UA-Compatible" content="IE=edge">\n        <meta name="description" content="">\n        <meta name="generator" content="GitBook 3.2.3">\n        \n        \n        \n    \n    \n        \n        \n        \n    \n\n    \n            \n        \n\n    \n\n    \n        \n    \n        \n    \n        \n    \n        \n    \n        \n    \n        \n    \n\n        \n    </head>\n    <body style="margin: 0; font-family: sans-serif; color: #000; text-size-adjust: 100%; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">\n        \n<div class="pdf-footer" style="margin-top: 20px; padding-top: 10px; border-top: 1px solid #eee; color: #aaa;">\n    <span></span>\n    <span class="footer-pages-count" style="float: right;">_PAGENUM_</span>\n</div>\n\n        \n    </body>\n</html>\n\n'
  pdf_mono_font_size: 12
  breadth_first: True
  level2_toc: u"descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-2 ')]"
  chapter: u"descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter ')]"
  margin_left: 62.0
1% Converting input to HTML...
InputFormatPlugin: HTML Input running
on /var/folders/49/qb67km8d1n74znb66q5yxpdw0000gn/T/tmp-61026OOlPu30ogdHg/SUMMARY.html
Language not specified
Creator not specified
Building file list...
Normalizing filename cases
Rewriting HTML links
34% Running transforms on e-book...
Merging user specified metadata...
Detecting structure...
    Detected chapter: Chapter 1: Introduction
    Detected chapter: Chapter 2: From Rails 2.3 to 3.0
    Detected chapter: Chapter 3: From Rails 3.0 to 3.1
    Detected chapter: Chapter 4: From Rails 3.1 to 3.2
    Detected chapter: Chapter 5: From Rails 3.2 to 4.0 Part 1
    Detected chapter: Chapter 6: From Rails 3.2 to 4.0 Part 2
    Detected chapter: Chapter 7: From Rails 4.0 to 4.1
    Detected chapter: Chapter 8: From Rails 4.1 to 4.2
    Detected chapter: Chapter 9: From Rails 4.2 to 5.0
    Detected chapter: Chapter 10: 5-1 API Changes
Auto generated TOC with 10 entries.
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Cleaning up manifest...
Trimming unused files from manifest...
Creating PDF Output...
67% Running PDF Output plugin
Python function terminated unexpectedly: dlopen(/Applications/calibre.app/Contents/Resources/Python/site-packages/PyQt5/QtWidgets.so, 2): Library not loaded: @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets
  Referenced from: /Applications/calibre.app/Contents/Resources/Python/site-packages/PyQt5/QtWidgets.so
  Reason: Incompatible library version: QtWidgets.so requires version 5.6.0 or later, but QtWidgets provides version 5.5.0
Traceback (most recent call last):
  File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 154, in main
    return run_entry_point()
  File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 114, in run_entry_point
    return getattr(pmod, func)()
  File "site-packages/calibre/ebooks/conversion/cli.py", line 391, in main
  File "site-packages/calibre/ebooks/conversion/plumber.py", line 1252, in run
  File "site-packages/calibre/ebooks/conversion/plugins/pdf_output.py", line 146, in convert
  File "site-packages/calibre/gui2/__init__.py", line 7, in <module>
ImportError: dlopen(/Applications/calibre.app/Contents/Resources/Python/site-packages/PyQt5/QtWidgets.so, 2): Library not loaded: @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets
  Referenced from: /Applications/calibre.app/Contents/Resources/Python/site-packages/PyQt5/QtWidgets.so
  Reason: Incompatible library version: QtWidgets.so requires version 5.6.0 or later, but QtWidgets provides version 5.5.0

What is the expected behavior?

When I run gitbook pdf ./ rails-upgrade.pdf, I would expect it to generate a pdf file.

Environment

Some details about my environment (Mac OS X High Sierra: 10.13.4):

> gitbook --version
CLI version: 2.3.2
GitBook version: 3.2.3
> /usr/local/opt/qt/bin/qmake --version
QMake version 3.1
Using Qt version 5.11.0 in /usr/local/Cellar/qt/5.11.0/lib
> echo $PATH
/Users/etagwerker/.nvm/versions/node/v9.9.0/bin:/usr/local/opt/qt/bin:/usr/local/opt/qt/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/etagwerker/.rvm/gems/ruby-2.4.1/bin:/Users/etagwerker/.rvm/gems/ruby-2.4.1@global/bin:/Users/etagwerker/.rvm/rubies/ruby-2.4.1/bin:/Users/etagwerker/.rvm/bin:/Users/etagwerker/.cabal/bin:bin:/Users/etagwerker/.dotfiles/bin:/usr/local/bin:/Users/etagwerker/.rvm/bin
uname -a
Darwin foo.local 17.5.0 Darwin Kernel Version 17.5.0: Mon Mar  5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64

I realize that this might be an issue with PyQt5, but I thought I should reach out anyway. FWIW gitbook serve works perfectly.

Please let me know if you have any suggestions.

Thanks!

etagwerker commented 6 years ago

As a workaround I'm considering this: https://github.com/GitbookIO/gitbook/issues/1470#issuecomment-238621433

StefanoDeVuono commented 5 years ago

Did you at any point install qt55 with brew?