[PyQt] TypeError related to dbus.mainloop when building PyQt
Phil Thompson
phil at riverbankcomputing.com
Thu Apr 28 17:33:50 BST 2016
On 27 Apr 2016, at 3:36 pm, Florian Bruhin <me at the-compiler.org> wrote:
>
> When building the current snapshots of Qt/PyQt/sip I get this:
>
> Checking to see if the dbus support module should be built...
> pkg-config --cflags-only-I --libs dbus-1
> An internal error occured. Please report all the output from the program,
> including the following traceback, to support at riverbankcomputing.com.
> Traceback (most recent call last):
> File "configure.py", line 2896, in <module>
> main(sys.argv)
> File "configure.py", line 2880, in main
> check_dbus(target_config, opts.verbose)
> File "configure.py", line 2131, in check_dbus
> target_config.pydbus_module_dir = dbus.mainloop.__path__[0] TypeError: '_NamespacePath' object does not support indexing
>
> And I can reproduce the same when using Python directly too:
>
> [user at 54c8a06abe39 PyQt5_gpl-5.6.1.dev1604260930]$ python3
> Python 3.5.1 (default, Mar 3 2016, 09:29:07)
> [GCC 5.3.0] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import dbus.mainloop
> >>> dbus.mainloop.__path__
> _NamespacePath(['/usr/lib/python3.5/site-packages/dbus/mainloop'])
> >>> dbus.mainloop.__path__[0]
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> TypeError: '_NamespacePath' object does not support indexing
>
> What does work (though it's private attribute access...) is using
> _path:
>
> >>> dbus.mainloop.__path__._path
> ['/usr/lib/python3.5/site-packages/dbus/mainloop']
> >>> dbus.mainloop.__path__._path[0]
> '/usr/lib/python3.5/site-packages/dbus/mainloop'
Can you try changing...
target_config.pydbus_module_dir = dbus.mainloop.__path__[0]
...to...
target_config.pydbus_module_dir = list(dbus.mainloop.__path__)[0]
Phil
More information about the PyQt
mailing list