ValueError: API 'QDate' has already been set to version 1` #1418

Open
opened 2018-12-27 10:17:52 +01:00 by bl4k1st · 8 comments
bl4k1st commented 2018-12-27 10:17:52 +01:00 (Migrated from github.com)

I constantly get the following error:

Loading existing config files from /root/.config/PyBitmessage/ Using default logger configuration 2018-10-09 14:26:55,215 - ERROR - /root/.namecoin/namecoin.conf unreadable or missing, Namecoin support deactivated 2018-10-09 14:26:55,368 - CRITICAL - Unhandled exception Traceback (most recent call last): File "bitmessagemain.py", line 434, in <module> main() File "bitmessagemain.py", line 431, in main mainprogram.start() File "bitmessagemain.py", line 333, in start bitmessageqt.run() File "/root/PROGRAMS/PyBitmessage-0.6.3.2/src/bitmessageqt/__init__.py", line 4403, in run myapp = MyForm() File "/root/PROGRAMS/PyBitmessage-0.6.3.2/src/bitmessageqt/__init__.py", line 579, in __init__ self.ui.setupUi(self) File "/root/PROGRAMS/PyBitmessage-0.6.3.2/src/bitmessageqt/bitmessageui.py", line 559, in setupUi self.blackwhitelist = Blacklist() File "/root/PROGRAMS/PyBitmessage-0.6.3.2/src/bitmessageqt/blacklist.py", line 17, in __init__ widgets.load('blacklist.ui', self) File "/root/PROGRAMS/PyBitmessage-0.6.3.2/src/bitmessageqt/widgets.py", line 13, in load uic.loadUi(resource_path(resFile), widget) File "/usr/lib/python2.7/dist-packages/PyQt4/uic/__init__.py", line 236, in loadUi return DynamicUILoader(package).loadUi(uifile, baseinstance, resource_suffix) File "/usr/lib/python2.7/dist-packages/PyQt4/uic/Loader/loader.py", line 50, in __init__ UIParser.__init__(self, QtCore, QtGui, LoaderCreatorPolicy(package)) File "/usr/lib/python2.7/dist-packages/PyQt4/uic/uiparser.py", line 183, in __init__ self.factory = QObjectCreator(creatorPolicy) File "/usr/lib/python2.7/dist-packages/PyQt4/uic/objcreator.py", line 94, in __init__ modinfo = plugin_locals["moduleInformation"]() File "<string>", line 52, in moduleInformation File "/usr/lib/python2.7/dist-packages/qgis/__init__.py", line 26, in <module> from qgis.PyQt import QtCore File "/usr/lib/python2.7/dist-packages/qgis/PyQt/QtCore.py", line 28, in <module> sip.setapi(api, 2) ValueError: API 'QDate' has already been set to version 1

I constantly get the following error: `Loading existing config files from /root/.config/PyBitmessage/ Using default logger configuration 2018-10-09 14:26:55,215 - ERROR - /root/.namecoin/namecoin.conf unreadable or missing, Namecoin support deactivated 2018-10-09 14:26:55,368 - CRITICAL - Unhandled exception Traceback (most recent call last): File "bitmessagemain.py", line 434, in <module> main() File "bitmessagemain.py", line 431, in main mainprogram.start() File "bitmessagemain.py", line 333, in start bitmessageqt.run() File "/root/PROGRAMS/PyBitmessage-0.6.3.2/src/bitmessageqt/__init__.py", line 4403, in run myapp = MyForm() File "/root/PROGRAMS/PyBitmessage-0.6.3.2/src/bitmessageqt/__init__.py", line 579, in __init__ self.ui.setupUi(self) File "/root/PROGRAMS/PyBitmessage-0.6.3.2/src/bitmessageqt/bitmessageui.py", line 559, in setupUi self.blackwhitelist = Blacklist() File "/root/PROGRAMS/PyBitmessage-0.6.3.2/src/bitmessageqt/blacklist.py", line 17, in __init__ widgets.load('blacklist.ui', self) File "/root/PROGRAMS/PyBitmessage-0.6.3.2/src/bitmessageqt/widgets.py", line 13, in load uic.loadUi(resource_path(resFile), widget) File "/usr/lib/python2.7/dist-packages/PyQt4/uic/__init__.py", line 236, in loadUi return DynamicUILoader(package).loadUi(uifile, baseinstance, resource_suffix) File "/usr/lib/python2.7/dist-packages/PyQt4/uic/Loader/loader.py", line 50, in __init__ UIParser.__init__(self, QtCore, QtGui, LoaderCreatorPolicy(package)) File "/usr/lib/python2.7/dist-packages/PyQt4/uic/uiparser.py", line 183, in __init__ self.factory = QObjectCreator(creatorPolicy) File "/usr/lib/python2.7/dist-packages/PyQt4/uic/objcreator.py", line 94, in __init__ modinfo = plugin_locals["moduleInformation"]() File "<string>", line 52, in moduleInformation File "/usr/lib/python2.7/dist-packages/qgis/__init__.py", line 26, in <module> from qgis.PyQt import QtCore File "/usr/lib/python2.7/dist-packages/qgis/PyQt/QtCore.py", line 28, in <module> sip.setapi(api, 2) ValueError: API 'QDate' has already been set to version 1`
g1itch commented 2018-12-27 10:40:26 +01:00 (Migrated from github.com)

OK, I understood the problem is with some widget plugin from qgis.

OK, I understood the problem is with some widget plugin from qgis.
g1itch commented 2018-12-27 10:50:01 +01:00 (Migrated from github.com)
Is this also your post? https://forums.kali.org/showthread.php?42270-How-to-get-PyBitMessage-running-on-latest-Kali
bl4k1st commented 2018-12-27 10:54:32 +01:00 (Migrated from github.com)

yes

yes
g1itch commented 2018-12-27 11:10:45 +01:00 (Migrated from github.com)

Please try this patch:

diff --git a/src/depends.py b/src/depends.py
index 9a2e2158..481f4d4d 100755
--- a/src/depends.py
+++ b/src/depends.py
@@ -385,6 +385,11 @@ def check_pyqt():
     Here we are checking for PyQt4 with its version, as for it require
     PyQt 4.8 or later.
     """
+    try:
+        import sip
+        sip.setapi('QDate', 2)
+    except ImportError, ValueError:
+        pass
     QtCore = try_import(
         'PyQt4.QtCore', 'PyBitmessage requires PyQt 4.8 or later and Qt 4.7 or later.')
Please try this patch: ```patch diff --git a/src/depends.py b/src/depends.py index 9a2e2158..481f4d4d 100755 --- a/src/depends.py +++ b/src/depends.py @@ -385,6 +385,11 @@ def check_pyqt(): Here we are checking for PyQt4 with its version, as for it require PyQt 4.8 or later. """ + try: + import sip + sip.setapi('QDate', 2) + except ImportError, ValueError: + pass QtCore = try_import( 'PyQt4.QtCore', 'PyBitmessage requires PyQt 4.8 or later and Qt 4.7 or later.') ```
bl4k1st commented 2018-12-27 11:32:49 +01:00 (Migrated from github.com)

python bitmessagemain.py
Loading existing config files from /root/.config/PyBitmessage/
2018-12-27 11:28:49,998 - WARNING - Using default logger configuration
make: Entering directory '/root/PROGRAMS/PyBitmessage/src/bitmsghash'
g++ -Wall -O3 -march=native -fPIC -c bitmsghash.cpp
g++ bitmsghash.o -shared -fPIC -lcrypto -lpthread -o bitmsghash.so
make: Leaving directory '/root/PROGRAMS/PyBitmessage/src/bitmsghash'
2018-12-27 11:28:52,087 - CRITICAL - Unhandled exception
Traceback (most recent call last):
File "bitmessagemain.py", line 473, in
main()
File "bitmessagemain.py", line 469, in main
mainprogram.start()
File "bitmessagemain.py", line 361, in start
bitmessageqt.run()
File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/init.py", line 4456, in run
myapp = MyForm()
File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/init.py", line 589, in init
self.ui.setupUi(self)
File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/bitmessageui.py", line 559, in setupUi
self.blackwhitelist = Blacklist()
File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/blacklist.py", line 17, in init
widgets.load('blacklist.ui', self)
File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/widgets.py", line 13, in load
uic.loadUi(resource_path(resFile), widget)
File "/usr/lib/python2.7/dist-packages/PyQt4/uic/init.py", line 236, in loadUi
return DynamicUILoader(package).loadUi(uifile, baseinstance, resource_suffix)
File "/usr/lib/python2.7/dist-packages/PyQt4/uic/Loader/loader.py", line 50, in init
UIParser.init(self, QtCore, QtGui, LoaderCreatorPolicy(package))
File "/usr/lib/python2.7/dist-packages/PyQt4/uic/uiparser.py", line 183, in init
self.factory = QObjectCreator(creatorPolicy)
File "/usr/lib/python2.7/dist-packages/PyQt4/uic/objcreator.py", line 94, in init
modinfo = plugin_locals"moduleInformation"
File "", line 52, in moduleInformation
File "/usr/lib/python2.7/dist-packages/qgis/init.py", line 26, in
from qgis.PyQt import QtCore
File "/usr/lib/python2.7/dist-packages/qgis/PyQt/QtCore.py", line 28, in
sip.setapi(api, 2)
ValueError: API 'QDateTime' has already been set to version 1

> python bitmessagemain.py Loading existing config files from /root/.config/PyBitmessage/ 2018-12-27 11:28:49,998 - WARNING - Using default logger configuration make: Entering directory '/root/PROGRAMS/PyBitmessage/src/bitmsghash' g++ -Wall -O3 -march=native -fPIC -c bitmsghash.cpp g++ bitmsghash.o -shared -fPIC -lcrypto -lpthread -o bitmsghash.so make: Leaving directory '/root/PROGRAMS/PyBitmessage/src/bitmsghash' 2018-12-27 11:28:52,087 - CRITICAL - Unhandled exception Traceback (most recent call last): File "bitmessagemain.py", line 473, in <module> main() File "bitmessagemain.py", line 469, in main mainprogram.start() File "bitmessagemain.py", line 361, in start bitmessageqt.run() File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/__init__.py", line 4456, in run myapp = MyForm() File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/__init__.py", line 589, in __init__ self.ui.setupUi(self) File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/bitmessageui.py", line 559, in setupUi self.blackwhitelist = Blacklist() File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/blacklist.py", line 17, in __init__ widgets.load('blacklist.ui', self) File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/widgets.py", line 13, in load uic.loadUi(resource_path(resFile), widget) File "/usr/lib/python2.7/dist-packages/PyQt4/uic/__init__.py", line 236, in loadUi return DynamicUILoader(package).loadUi(uifile, baseinstance, resource_suffix) File "/usr/lib/python2.7/dist-packages/PyQt4/uic/Loader/loader.py", line 50, in __init__ UIParser.__init__(self, QtCore, QtGui, LoaderCreatorPolicy(package)) File "/usr/lib/python2.7/dist-packages/PyQt4/uic/uiparser.py", line 183, in __init__ self.factory = QObjectCreator(creatorPolicy) File "/usr/lib/python2.7/dist-packages/PyQt4/uic/objcreator.py", line 94, in __init__ modinfo = plugin_locals["moduleInformation"]() File "<string>", line 52, in moduleInformation File "/usr/lib/python2.7/dist-packages/qgis/__init__.py", line 26, in <module> from qgis.PyQt import QtCore File "/usr/lib/python2.7/dist-packages/qgis/PyQt/QtCore.py", line 28, in <module> sip.setapi(api, 2) ValueError: API 'QDateTime' has already been set to version 1
bl4k1st commented 2018-12-27 11:41:17 +01:00 (Migrated from github.com)

Adding this to depends.py:
https://github.com/enthought/pyface/issues/286#issuecomment-335436808

results in

python bitmessagemain.py
Loading existing config files from /root/.config/PyBitmessage/
2018-12-27 11:39:59,368 - WARNING - Using default logger configuration
2018-12-27 11:40:01,020 - CRITICAL - Unhandled exception
Traceback (most recent call last):
File "bitmessagemain.py", line 473, in
main()
File "bitmessagemain.py", line 469, in main
mainprogram.start()
File "bitmessagemain.py", line 361, in start
bitmessageqt.run()
File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/init.py", line 4456, in run
myapp = MyForm()
File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/init.py", line 589, in init
self.ui.setupUi(self)
File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/bitmessageui.py", line 566, in setupUi
self.networkstatus = NetworkStatus()
File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/networkstatus.py", line 37, in init
self.labelStartupTime.setText(_translate("networkstatus", "Since startup on %1").arg(
AttributeError: 'unicode' object has no attribute 'arg'

Adding this to depends.py: https://github.com/enthought/pyface/issues/286#issuecomment-335436808 results in > python bitmessagemain.py Loading existing config files from /root/.config/PyBitmessage/ 2018-12-27 11:39:59,368 - WARNING - Using default logger configuration 2018-12-27 11:40:01,020 - CRITICAL - Unhandled exception Traceback (most recent call last): File "bitmessagemain.py", line 473, in <module> main() File "bitmessagemain.py", line 469, in main mainprogram.start() File "bitmessagemain.py", line 361, in start bitmessageqt.run() File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/__init__.py", line 4456, in run myapp = MyForm() File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/__init__.py", line 589, in __init__ self.ui.setupUi(self) File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/bitmessageui.py", line 566, in setupUi self.networkstatus = NetworkStatus() File "/root/PROGRAMS/PyBitmessage/src/bitmessageqt/networkstatus.py", line 37, in __init__ self.labelStartupTime.setText(_translate("networkstatus", "Since startup on %1").arg( AttributeError: 'unicode' object has no attribute 'arg'
g1itch commented 2018-12-27 11:52:52 +01:00 (Migrated from github.com)

No way. bitmessageqt currently uses QString. You can try qt5-wip branch or wait until I find a better workaround.

No way. `bitmessageqt` currently uses `QString`. You can try `qt5-wip` branch or wait until I find a better workaround.
bl4k1st commented 2018-12-27 12:05:23 +01:00 (Migrated from github.com)

Ok, I cloned qt5-wip, this is starting.
Thank you :)

Ok, I cloned qt5-wip, this is starting. Thank you :)
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Bitmessage/PyBitmessage-2024-12-20#1418
No description provided.