[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] py3qt5 system path
From:       Baz Walter <bazwal () ftml ! net>
Date:       2017-06-28 13:18:39
Message-ID: 950dc9d3-2951-eafc-53e4-8a4df3929fee () ftml ! net
[Download RAW message or body]

On 28/06/17 08:47, Ritesh Raj Sarraf wrote:
> On Wed, 2017-06-28 at 08:21 +0200, Vincent Vande Vyvre wrote:
>> Then, you have to write: from apt_offline_gui import resources.rc
> 
> I think you put a typo there. It should be resources_rc.
> 
> I tried it but that did not work. I think the problem lies with pyuic4, which
> generates the .py files from the .ui files. Because my exception lies in there.
> 
> rrs@learner:~/rrs-home/devel/apt-offline/apt-offline (master)$ ./apt-offline-
> gui
> Traceback (most recent call last):
>    File "./apt-offline-gui", line 29, in <module>
>      from apt_offline_gui import AptOfflineQtMain
>    File "/media/SSHD/rrs-home/devel/apt-offline/apt-
> offline/apt_offline_gui/AptOfflineQtMain.py", line 4, in <module>
>      from apt_offline_gui.Ui_AptOfflineQtMain import Ui_AptOfflineMain
>    File "/media/SSHD/rrs-home/devel/apt-offline/apt-
> offline/apt_offline_gui/Ui_AptOfflineQtMain.py", line 155, in <module>
>      import resources_rc
> ImportError: No module named 'resources_rc'
> 2017-06-28 / 13:29:55 ♒♒♒  ☹  => 1
> 
> The bug I see is, that the user is not supposed to hand-update the generated files.
> That's why I asked here is this is a bug.
> 

Compile the gui modules like this:

     pyuic4 --from-imports -o $OUTDIR/output.py input.ui

This will add the correct import statement to the end of the generated 
gui module. You should then compile the resources module like this:

     pyrcc4 -o $OUTDIR/resources_rc.py resources.qrc

For this to work, the resources module **MUST** be written to the same 
directory as the gui modules. Also, the resources file **MUST** be named 
"resources_rc.py" (although, if you really need to, you can modify it 
slightly using the pyuic4 --resource-suffix option).
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic