ImportError: cannot import name QImage on debian 7

Bug #1584513 reported by perler
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
calibre
Invalid
Undecided
Unassigned

Bug Description

it looks a bit like #1247315 but the solution there doesn't help.

after upgrading to the latest release of calibre, when starting I get:

Starting Calibre
Traceback (most recent call last):
  File "site.py", line 64, in main
  File "site-packages/calibre/library/server/main.py", line 12, in <module>
  File "site-packages/calibre/library/server/base.py", line 21, in <module>
  File "site-packages/calibre/library/server/content.py", line 14, in <module>
  File "site-packages/calibre/utils/img.py", line 10, in <module>
ImportError: cannot import name QImage

perler (perler)
summary: - ImportError: cannot import name QImage on devian 7
+ ImportError: cannot import name QImage on debian 7
Revision history for this message
Eli Schwartz (eschwartz) wrote :

In what way does the solution there not help? It is the same theory, but with a different import.

LD_DEBUG=libs calibre-debug -c "from PyQt5.Qt import QImage"

Revision history for this message
perler (perler) wrote :

I simply tried deleting libz.so.1

$LD_DEBUG=libs calibre-debug -c "from PyQt5.Qt import QImage"

brings

bash: =libs: command not found

I am not sure what to do here

Revision history for this message
Eli Schwartz (eschwartz) wrote :

Well, obviously deleting a file that was outdated two years and 96 versions ago (and was long since fixed) is not going to fix anything...

And why on earth are you using the commandline (now where did that dollar sign come from):
$LD_DEBUG=libs calibre-debug -c "from PyQt5.Qt import QImage"

No one told you to use that, you were told to use:
LD_DEBUG=libs calibre-debug -c "from PyQt5.Qt import QImage"

...
...

A tip on shell command syntax:

LD_DEBUG=libs sets the desired variable LD_DEBUG to "libs"
$LD_DEBUG=libs first expands the value of $LD_DEBUG (which is nothing) and translates to "=libs" which is *not* valid bash syntax for setting a variable, and sure as heck isn't a command either, hence your "command not found" error.

Moral of the story -- when you know why the command you were given is wrong, then and only then should you try to "fix" it. ;)

Revision history for this message
perler (perler) wrote :

..attached is the log file. the server is headless btw.

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1584513

You are missing the X libraries in this case libGL.so which Qt needs and
calibre does not bundle. Note that you only need to have the libraries
installed, not a running X instance.

 status invalid

Changed in calibre:
status: New → Invalid
Revision history for this message
perler (perler) wrote :

ok, I had to install

apt-get install libgl1-mesa-glx

on debian 7. but this wasn't necessary until recently.

Revision history for this message
James Biederbeck (jbiederbeck) wrote :

I'm experiencing the same issue, and found this page on google. Clean ubuntu 14.04 install on a vps, and all other software should be up to date.

I guess this raises the question, why should I need X if I'm running headless, and using calibre on the command line?

Revision history for this message
Eli Schwartz (eschwartz) wrote : Re: [Bug 1584513] Re: ImportError: cannot import name QImage on debian 7

> I guess this raises the question, why should I need X if I'm running
> headless, and using calibre on the command line?

Um, because Qt headless plugins require the X libraries in order to use
X headlessly? What kind of question is that???

And, you did read the FAQ, right?
https://manual.calibre-ebook.com/faq.html#how-do-i-run-parts-of-calibre-like-news-download-and-the-content-server-on-my-own-linux-server

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.