Calibre Installation Fails On C7

Home » CentOS » Calibre Installation Fails On C7
CentOS 15 Comments

Attempting to install latest Calibre on CentOS-7, getting:

2015-12-22 21:32:38 URL:https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py [25887/25887] -> “-” [1]
Installing to /home/fredex/calibre-bin/calibre Downloading tarball signature securely… Traceback (most recent call last):
File ““, line 1, in
File ““, line 670, in main
File ““, line 655, in run_installer
File ““, line 627, in download_and_extract
File ““, line 619, in get_tarball_info
File ““, line 578, in get_https_resource_securely
File ““, line 487, in __init__
File “/usr/lib64/python2.7/httplib.py”, line 1182, in __init__
context.load_cert_chain(cert_file, key_file)
ssl.SSLError: [SSL] PEM lib (_ssl.c:2757)

Can anybody advise me what this tells me? (other than SOMETHING wrong with some certificate…)

Thanks!

15 thoughts on - Calibre Installation Fails On C7

  • Nope. makes no difference.


    —- Fred Smith — fredex@fcshome.stoneham.ma.us —————————–
    “And he will be called Wonderful Counselor, Mighty God, Everlasting Father,
    Prince of Peace. Of the increase of his government there will be no end. He will reign on David’s throne and over his kingdom, establishing and upholding
    it with justice and righteousness from that time on and forever.”
    ——————————- Isaiah 9:7 (niv) ——————————

  • Calibre is a powerful e-book management program (take a look at calibre-ebook.com), written in Python.

    the recommended way to install it on Linux systems is:

    sudo -v && wget -nv -O- https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py | sudo python -c “import sys; main=lambda:sys.stderr.write(‘Download failed\n’); exec(sys.stdin.read()); main()”

    there are a couple of alternatives but they’re all very much like that.

    here’s what I actually ran the last time I attempted this:

    wget -nv -O- https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py | python -c “import sys; main=lambda x,y:sys.stderr.write(‘Download failed\n’); exec(sys.stdin.read()); main(‘~/calibre-bin’, True)”
    2015-12-22 07:44:40 URL:https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py [25887/25887] -> “-” [1]
    Installing to /home/fredex/calibre-bin/calibre Downloading tarball signature securely… Traceback (most recent call last):
    File ““, line 1, in
    File ““, line 670, in main
    File “
    “, line 655, in run_installer
    File “
    “, line 627, in download_and_extract
    File “
    “, line 619, in get_tarball_info
    File “
    “, line 578, in get_https_resource_securely
    File “
    “, line 487, in __init__
    File “/usr/lib64/python2.7/httplib.py”, line 1182, in __init__
    context.load_cert_chain(cert_file, key_file)
    ssl.SSLError: [SSL] PEM lib (_ssl.c:2757)

    googling for that doesn’t turn up much help for Calibre, though similar
    (but different) sets of errors turn up in a lot of places. So far I’ve not found any of them helpful.

    One of them said something about the installed Python packages being broken in some way, and that if he rebuilt it from source and installed his that the problem went away. But I’m not yet ready to go that effort, still holding out for a simpler solution.

    I also posted on the Calibre fora (forums for the Latinly-challenged)
    and am waiting for advice there.

    Fred

  • . . .

    The error you are reporting may be due to some misconfiguration of the certificate chain in the Python libraries. Likely the case if you recently updated to 7.2 as others have reported the same thing. You can try to perform a manual download and install, thus bypassing the whole SSL mess, and see if that works. Quoting from the Calibre website:

    http://calibre-ebook.com/download_linux

    Manual binary install or reverting to a previous version

    If you wish to revert to an earlier calibre release or download a calibre upgrade manually, download the tarball of that release from here (choose the 32-bit or 64-bit version, as appropriate). Assuming you want calibre in /opt/calibre, run the following command, changing the path to calibre-tarball.txz below as appropriate:

    sudo mkdir -p /opt/calibre && sudo rm -rf /opt/calibre/* && sudo tar xvf /path/to/downloaded/calibre-tarball.txz -C /opt/calibre &&
    sudo /opt/calibre/calibre_postinstall

    HTH.

  • I skimmed that python script, and it seems to be making an SSL
    connection to https://code.calibre-ebook.com/ which appears to have a self-signed certificate. It looks like it includes the cert file, but python 2.7 doesn’t appear to like you just using httplib.HTTPSConnection without a key file too, which isn’t included.
    (see https://docs.python.org/2/library/httplib.html#httplib.HTTPSConnection
    )

    I suspect this must be a bug in the upstream code.

  • James:

    Thanks for the detailed post.

    On the Calibre forum, Kovid Goyal (Calibre maintainer) said basically the same thing, so I did the manual install.

    I’m wondering, is this a Python (packaging??) bug that needs to be put in CentOS and/or RH bug databases?

    thanks again!

    Fred

  • I tried making sure all the packages were installed on the bottom of the page:

    http://calibre-ebook.com/download_linux <http://calibre-ebook.com/download_linux>

    but then qmake wasn’t available, so I found I needed qt3 installed. Installed that and tried installing again:

    python setup.py install Traceback (most recent call last):
    File “setup.py”, line 13, in
    import setup.commands as commands
    File “/home/xulu/Downloads/calibre/calibre-2.47.0/setup/commands.py”, line 28, in

    from setup.translations import POT, GetTranslations, Translations, ISO639, ISO3166
    File “/home/xulu/Downloads/calibre/calibre-2.47.0/setup/translations.py”, line 14, in

    from setup.parallel_build import parallel_check_output
    File “/home/xulu/Downloads/calibre/calibre-2.47.0/setup/parallel_build.py”, line 14, in

    from setup.build_environment import cpu_count
    File “/home/xulu/Downloads/calibre/calibre-2.47.0/setup/build_environment.py”, line 98, in

    from PyQt5.QtCore import PYQT_CONFIGURATION
    ImportError: No module named PyQt5.QtCore

    Hmm. So I tried:

    sudo pip install python-qt5
    Collecting python-qt5
    Using cached python-qt5-0.1.10.zip No files/directories in /tmp/pip-build-5OToGt/python-qt5/pip-egg-info (from PKG-INFO)

    and get the error above. So I’m stuck there. But I don’t see a /tmp/pip-build…. either??

    -wes

  • I finally got it compiled and when I run it in virtualbox 5.0.12, I get this:

    Could not initialize GLX

    Maybe it would work on a real box??

    -wes

  • VBox has virtual GLX support, it has to be enabled and configured, and of course, the guest would need GL installed, etc.

  • I just went through the build it yourself process. Give this a try:

    open terminal

    cd Downloads

    download qt-unified-linux-x64-2.0.2-2-online.run from http://www.qt.io/download-open-source/
    chmod +x qt-unified-linux-x64-2.0.2-2-online.run sudo ./qt-unified-linux-x64-2.0.2-2-online.run

    after install qt above, edit your .bashrc file and add:

    export PATH=/opt/Qt/5.5/gcc_64/bin:$PATH

    then run

    . ~/.bashrc

    sudo yum install python-devel -y

    wget http://sourceforge.net/projects/pyqt/files/sip/sip-4.17/sip-4.17.tar.gz tar -zxf sip-4.17.tar.gz cd sip-4.17
    python configure.py make sudo make install

    cd ..

    sudo yum install python-pip -y sudo pip install mechanize sudo yum install ImageMagick-devel -y sudo yum install libxslt-devel libxml2-devel -y

    wget http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm sudo rpm -Uvh nux-dextop-release-0-5.el7.nux.noarch.rpm sudo yum install python-cssutils -y

    sudo yum install podofo -y sudo yum install libwmf -y sudo yum install libmtp-devel -y sudo yum install python-netifaces -y sudo yum install python-psutil -y sudo yum install python-apsw -y sudo yum install python-dbus -y sudo yum install python-pygments -y sudo yum install optipng -y

    wget http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.5.1/PyQt-gpl-5.5.1.tar.gz tar -zxf PyQt-gpl-5.5.1.tar.gz cd PyQt-gpl-5.5.1
    python configure.py –disable QtPositioning make sudo make install

    cd ..

    sudo yum install python-imaging -y sudo yum install sqlite-devel -y sudo yum install chmlib-devel -y sudo yum install podofo-devel -y sudo yum install libusbx-devel -y sudo yum install qt5-qtbase-static -y sudo yum install libudev-devel -y sudo yum install openssl-devel -y sudo yum install libicu-devel -y sudo yum install libXrender-devel -y

    curl -L http://code.calibre-ebook.com/dist/src | tar xvJ
    cd calibre-2.47.0

    sudo python setup.py install

    then type in the program name at the terminal prompt and press enter:

    calibre

    ——

    -wes

  • Wes, thanks for following up.

    But I wonder if Calibre is worth that much work?

    The specific problem I had can be worked around just by following the instructions on the Calibre downloadpge for “manual install”. I did that and it appears to work properly.


    ——————————————————————————-
    Under no circumstances will I ever purchase anything offered to me as
    the result of an unsolicited e-mail message. Nor will I forward chain
    letters, petitions, mass mailings, or virus warnings to large numbers
    of others. This is my contribution to the survival of the online
    community.
    –Roger Ebert, December, 1996
    —————————– The Boulder Pledge —————————–

  • Good! I don’t know how Johnny keeps the CentOS distro rolling. Getting all the pieces to make it work is quite interesting.

    Happy holidays!

    -wes

  • dedication, hard work, and good helpers!

    Same right back atcha! :)


    ——————————————————————————-
    Under no circumstances will I ever purchase anything offered to me as
    the result of an unsolicited e-mail message. Nor will I forward chain
    letters, petitions, mass mailings, or virus warnings to large numbers
    of others. This is my contribution to the survival of the online
    community.
    –Roger Ebert, December, 1996
    —————————– The Boulder Pledge —————————–