0

While using PyQt5 in a project, I convert some .ui files tp .py files using pyuic5 -x design.ui -o design_ui.py. In the generated python file, there is this import statement: from ktreewidgetsearchline import KTreeWidgetSearchLine, which Python (3.6.1) is unable to find.

I am using Ubuntu 17.04. I have have tried to install KDE, and its development packages without luck.

Can someone point me in the right direction? Where might I find the proper python packages that are needed for displaying the widgets? Alternatively, how might I configure / tell PyQt / pyuic5 to generate files that can be shown in gnome / unity, or cross platform in general?

Thanks a lot :)

cLupus
  • 535
  • 6
  • 16
  • 2
    You could share the .ui file. Maybe you're adding KDE components? If you're doing it, do not. – eyllanesc Jul 04 '17 at 12:51
  • Unfortunately, I am not at liberty to disclose the file. However, you are right. There are KDE elements in it. It was originally designed in (Py)Qt4, might that matter? – cLupus Jul 04 '17 at 15:35
  • 1
    execute this: `sudo apt-get install python3-pykde4 ` – eyllanesc Jul 04 '17 at 15:41
  • Thanks for your help :) It would seem I have to change the design files to use something more standard, since this application is supposed to run on non-KDE as well. – cLupus Jul 04 '17 at 16:23

1 Answers1

0

I had similar problems with my project and solved it as follows:

  • For my project (see KSP Mod Analyzer on GitHub), I have the following structure:

    • ksp-mod-analyzer/ui/mainwindow.ui (UI created by QT Designer)
    • ksp-mod-analyzer/ui/resources.qrc (Resource file with icons)
  • Running pyuic5 --from-imports mainwindow.ui -o mainwindow.py added the following import directive to my mainwindow.py

    • from . import resources_rc

By this, the import command worked.

akej74
  • 1,174
  • 10
  • 8