[PyQt] Design plugins in Windows

Kyle Altendorf sda at fstab.net
Tue Mar 29 23:34:45 BST 2016

On 2016-03-29 04:09, Phil Thompson wrote:
> On 29 Mar 2016, at 12:05 am, Kyle Altendorf <sda at fstab.net> wrote:
>> On 2016-03-28 18:49, Kyle Altendorf wrote:
>>> On 2016-03-28 18:12, Phil Thompson wrote:
>>>> On 28 Mar 2016, at 10:47 pm, Kyle Altendorf <sda at fstab.net> wrote:
>>>>> While my Designer widgets work quite nicely in Linux (thank you) I 
>>>>> am unable to get them working in Windows.  I have tried many 
>>>>> permutations of / and \ and quotes or not in PYQTDESIGNERPATH.  I 
>>>>> also located my files in one of the default path locations 
>>>>> (C:\Users\IEUser\.designer\plugins\python).  In no case do they 
>>>>> show up within Designer (pyqt5.dll is listed as a plugin).  Any 
>>>>> recommendations on how to debug/resolve this before I attempt to 
>>>>> rebuild pyqt5.dll with debug statements written to a file?  My 
>>>>> widgets/plugins are available on GitHub [1].
>>>>> Thank you for any suggestions you care to share.
>>>>> Cheers,
>>>>> -kyle
>>>>> [1] 
>>>>> https://github.com/altendky/st/tree/fda167f20081ba0f24293d71535b68b2e6954bb0/epyq/widgets
>>>> Does the standard example work for you?
>>>> Phil
>>> No, it does not seem to work either via the examples app or from the
>>> command line.  In fact, unless I set PYTHONPATH to something else,
>>> Designer won't even open (so example app doesn't open Designer at
>>> all).  I looked for the widgets in the list and also for entries 
>>> under
>>> the listing of pyqt5.dll in the dialog under help and neither
>>>  C:\Users\IEUser>set
>>> PYQTDESIGNERPATH=c:\python34\lib\site-packages\PyQt5\examples\designer\plugins\python
>>>  C:\Users\IEUser>set
>>> PYTHONPATH=c:\python34\lib\site-packages\PyQt5\examples\designer\plugins\widgets
>>>  C:\Users\IEUser>designer
>>> <no output nor designer window>
>>>  C:\Users\IEUser>set
>>> PYTHONPATH=c:\python34\lib\site-packages\PyQt5\examples\designer\plugins\widget
>>>  C:\Users\IEUser>designer
>>>  C:\Users\IEUser>
>>> <no output but designer window comes up>
>>> I'm bringing up a fresh virtual machine (modern.ie Vagrant/Win10/Edge
>>> x64) and will install Python 3.4.4 and PyQt 5.5.1 (both x32).  I will
>>> let you know the results there.
>> The fresh virtual failed in the same way.  Any other particular 
>> combination you think it would be helpful to try?
> A side effect of the recent changes related to uncaught Python
> exceptions means that, if your plugin or widget implementation has
> bugs it will bring down Designer. There is such a bug in one of the
> PyQt examples (fixed in the current snapshot) which means the whole
> Designer plugins example will probably fail.

It ended up needing an extra directory in the %PYTHONPATH% and no "s.  I 
do absolute imports (not sure if that's good or bad, but it's what the 
code is right now) so I had to add not only the paths to the files but 
also the 'root' path for imports.  I am also quite used to quoting to 
avoid shell issues but that is bad in path environment variables 
apparently, even when done to each individual path.  So, I would presume 
I was triggering an import exception that managed not to kill Designer 
but did cause it not to show my widgets.


> You could try the latest version of the example, or remove the bad
> part of the version you have (it's the widget that uses OpenGL I
> think).

I stripped it down to the analog clock and it worked.  Following that I 
fiddled with my files and compared imports etc to figure out my path 

> I will look at ways of making the whole thing more resilient to 
> failures.

Sometimes a vow of silence is good.  Sometimes not.  :]  I certainly 
need to continue improving this in my own application.  As always, 
thanks for the help getting over this hump.  If I'm lucky, I can get my 
boss and coworkers to develop some of the GUI now.


More information about the PyQt mailing list