You are not logged in.

#1 2013-10-24 15:25:53

Stalafin
Member
From: Berlin, Germany
Registered: 2007-10-26
Posts: 617

[solved] calibre not starting: ImportError with PyQt4

Calibre, community/calibre 1.7.0-1, isn't starting on my system. I didn't try it for a whie and can therefore not pinpoint since when it does not work anymore.

This is the error message it gives me:

% calibre
Traceback (most recent call last):
  File "/usr/bin/calibre", line 19, in <module>
    from calibre.gui2.main import main
  File "/usr/lib/calibre/calibre/gui2/__init__.py", line 7, in <module>
    from PyQt4.Qt import (QVariant, QFileInfo, QObject, SIGNAL, QBuffer, Qt,
ImportError: /usr/lib/python3.3/site-packages/PyQt4/Qt.so: undefined symbol: PyModule_Create2
zsh: exit 1     calibre

Everything else on my system is up-to-date (just did a pacman -Syu).


EDIT: Be careful when setting PYTHONPATH - I missed it up and python2 was trying to use python3 libs.

Last edited by Stalafin (2013-10-24 18:21:59)

Offline

#2 2013-10-24 16:53:27

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [solved] calibre not starting: ImportError with PyQt4

That's because Calibre should be running with python2, not python3. Check "which calibre" to make sure it's running /usr/bin/caliber and check /usr/bin/calibre to make sure the shebang is "/usr/bin/env python2".

Offline

#3 2013-10-24 18:07:21

Stalafin
Member
From: Berlin, Germany
Registered: 2007-10-26
Posts: 617

Re: [solved] calibre not starting: ImportError with PyQt4

Scimmia wrote:

That's because Calibre should be running with python2, not python3. Check "which calibre" to make sure it's running /usr/bin/caliber and check /usr/bin/calibre to make sure the shebang is "/usr/bin/env python2".

Yeah, I thought about that myself, but both seem fine:

% which calibre
/usr/bin/calibre
% cat $(which calibre)
#!/usr/bin/env python2

"""
This is the standard runscript for all of calibre's tools.
Do not modify it unless you know what you are doing.
"""

import sys, os

path = os.environ.get('CALIBRE_PYTHON_PATH', '/usr/lib/calibre')
if path not in sys.path:
    sys.path.insert(0, path)

sys.resources_location = os.environ.get('CALIBRE_RESOURCES_PATH', '/usr/share/calibre')
sys.extensions_location = os.environ.get('CALIBRE_EXTENSIONS_PATH', '/usr/lib/calibre/calibre/plugins')
sys.executables_location = os.environ.get('CALIBRE_EXECUTABLES_PATH', '/usr/bin')


from calibre.gui2.main import main
sys.exit(main())

Offline

#4 2013-10-24 18:15:12

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [solved] calibre not starting: ImportError with PyQt4

how about "which python2"? It should be /usr/bin/python2, which is a symlink to python2.7

Offline

#5 2013-10-24 18:22:33

Stalafin
Member
From: Berlin, Germany
Registered: 2007-10-26
Posts: 617

Re: [solved] calibre not starting: ImportError with PyQt4

Scimmia wrote:

how about "which python2"? It should be /usr/bin/python2, which is a symlink to python2.7

I messed up - python2 was trying to use python3 libraries because of my bad PYTHONPATH.

Offline

Board footer

Powered by FluxBB