PyQt4 - Code generation faied: unable to launch...
Hello,
I am trying to use PyQt4 Designer, but I am having troubles running it. The Designer is runnig weell but when I go to Form -> View Code... an error ocurrs: Unable to lounch C:/Python25/PyQt4/bin\uic
I tried reinstalling it, etc., no solution.
I use PyQt4 installed from binary gpl
I use Python 2.5.2
When I type python in CMD the Python starts corretly
When i type in Python shell import PyQt4, it is importing corretly.
I use Windows Vista Ultimate SP1
Can you help me to make my PyQt4 Designer work :crying:
All the Best!
Re: PyQt4 - Code generation faied: unable to launch...
Maybe you should generate python code with pyuic4.bat file which installs in
c:\pythonXX dir?
pyuic4.bat youfile.ui >generated.py helps?
I personally load those ui files on the fly without generating python code:
something like this works for me:
Code:
import sys
from PyQt4 import QtCore,QtGui,uic
form_class, base_class = uic.loadUiType("unnamed.ui")
class MyWidget
(QtGui.
QWidget, form_class
): def __init__(self,parent=None,selected=[],flag=0,*args):
QtGui.
QWidget.__init__
(self,parent,
*args
) self.setupUi(self)
if __name__ == '__main__':
form = MyWidget(None)
form.show()
app.exec_()
Try this little script with your ui file.
Re: PyQt4 - Code generation faied: unable to launch...
Thank you for the support.
Yes I`ve already used the pyuic4.bat and pyrcc4.exe from the command line.. and it works fine.
Are there any advantages using the .ui file instead of the generated .py, optimization or something else?:eek:
Re: PyQt4 - Code generation faied: unable to launch...
Main advantage: no need to generate code :)
Just load ui file instead of loading generated code.
Disadvantage i think is a speed of execution.
May be it's a little slower than running pre-generated files...
Re: PyQt4 - Code generation faied: unable to launch...
Hi, I tried to use the script but I got the following error:
Can´t get _Z10forcepointR11QTextStream from the dinamic link library of Qtcore.dll
I need help!!! :)
I'm using Python 2.5 and PyQt v4.4.2
Edit: I have some problems importing QtCore!!!
Edit2: I have solved the error that was launched when I tried to compile the .ui file, if you have the same problem with the Qtcore4.dll on windows, you must copy Qtcore4.dll (C:\Python25\Lib\site-packages\PyQt4 in my PC) and paste it in windows/system32. It looks so primitive but it worked. Now my problem is to run de .py code because the "Import QtGui" sentence throws a DLL error again, I'll get crazy about this T_______T
Final Edit: Ok I solved it again, On windows we must copy and paste the DLL files into system32 folder to make them work with our .py file. Maybe some imports like QtCore and QtGui will throw a DLL error so If you have installed PyQt v4.4.2 on windows and you are using python 2.5 maybe you will have this path directory C:\Python25\PyQt4\bin.
In this folder you can find all de DLLs needed for using PyQt and you just have to copy them as you need them. :)
Once you have copied the DLL files you can compile de .ui file using the next command on console (cdm), and you must be loceted in the folder where you have the .ui file
pyuic4 -o fileName.py -x yourFileName.ui
and this will make your .py file from the .ui file
I hope my English writting becomes fine to understood :)
Re: PyQt4 - Code generation faied: unable to launch...
I have other problem ...
When creating resource file with pyrcc4 (on win7, PyQt4 ) ...
Code:
C:\Users\WM\workspace\ImageChanger\src>pyrcc4 -o qrc_resources.py resources.qrc
Console returns:
Code:
pyrcc4 Parse Error:resources.qrc:1:1 [unexpected end of file]
Help me Please!
Re: PyQt4 - Code generation faied: unable to launch...
Hi all!
Comming back to the topic od converting some ui to python code I am trying to do that..but have problems with using pyuic4. I lost my confidence in what l should use at all, is pyuic4 a good command to use? or should I use pyuic.bat file... or is there some other way to go?
Would be grateful if somebody could give me a hint how the command looks like on Windows?