Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #70794 > unrolled thread
| Started by | Steve Simmons <square.steve@gmail.com> |
|---|---|
| First post | 2014-05-01 01:49 +0100 |
| Last post | 2014-05-01 20:18 +0100 |
| Articles | 4 — 3 participants |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Slightly OT - using PyUIC from Eclipse Steve Simmons <square.steve@gmail.com> - 2014-05-01 01:49 +0100
Re: Slightly OT - using PyUIC from Eclipse Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-01 01:50 +0000
Re: Slightly OT - using PyUIC from Eclipse Mark H Harris <harrismh777@gmail.com> - 2014-04-30 22:03 -0500
Re: Slightly OT - using PyUIC from Eclipse Steve Simmons <square.steve@gmail.com> - 2014-05-01 20:18 +0100
| From | Steve Simmons <square.steve@gmail.com> |
|---|---|
| Date | 2014-05-01 01:49 +0100 |
| Subject | Re: Slightly OT - using PyUIC from Eclipse |
| Message-ID | <mailman.9619.1398905375.18130.python-list@python.org> |
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 30/04/2014 23:49, Fabio Zadrozny
wrote:<br>
</div>
<blockquote
cite="mid:CANXBEFrqndqCeT-9Hgqz7jRCZcmp8nz4VE+ebf-BKsYr54qQqQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Apr 30, 2014 at 8:39 AM,
Steve Simmons <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:square.steve@gmail.com" target="_blank">square.steve@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">I'm trying to set up a
new dev environment using Windows 7; Eclipse (Kepler);
Python 3.3; PyDev and PyQt 5 and I've hit an issue getting
PyUIC to generate a python Qt class from within Eclipse.<br>
<br>
I'm using the following setup process (from Google Groups)
modified to match my PyQt5 configuration:<br>
<br>
1. Click Run -> External Tools -> External Tools
Configurations ...<br>
2. In the resulting dialog, click 'New' icon in the top
left<br>
3. Under 'Name' put 'PyUIC'<br>
4. Under 'Location' enter 'C:\Program
Files\Python\2.5\Python.exe' or<br>
the path to your Python executable (probably
C:\Python25\Python.exe)<br>
5. Under 'Arguments' enter '"C:\Program
Files\Python\2.5\Lib\site-<br>
packages\PyQt4\uic\pyuic.py" "${resource_loc}"'
substituting the path<br>
to your PyQt4 installation - be sure also to include the
double quotes<br>
6. Change to the 'Common' tab and check 'File' under
'Standard Input/<br>
Output' and enter '${resource_loc}.py'<br>
7. Change to the 'Build' tab and uncheck 'Build before
launch'<br>
8. Change to the 'Refresh' tab and check 'Refresh
resources upon<br>
completion'<br>
9. Click 'Apply' then 'Run'<br>
<br>
and I'm getting the following traceback:<br>
<br>
Traceback (most recent call last):<br>
File "D:\Development\Python33\Lib\site-packages\PyQt5\uic\pyuic.py",<br>
line 28, in <module><br>
from .driver import Driver<br>
SystemError: Parent module '' not loaded, cannot perform
relative import<br>
<br>
I tried this on Qt4 a week or so ago and it worked OK but
Qt5 is giving me an error message, so I guess I've either
mis-transcribed or there's a difference in the directory
structure betwee PyQt4 & PyQt5.<br>
<br>
I'm more interested to learn how to read the traceback
(insightfully) and track it to the source of the problem,
although it would be good to have it working too!!<span
class=""><font color="#888888"><br>
<br>
Steve Simmons<br>
</font></span><br>
PS Also posted to PyQT list.<br>
-- <br>
<a moz-do-not-send="true"
href="https://mail.python.org/mailman/listinfo/python-list"
target="_blank">https://mail.python.org/mailman/listinfo/python-list</a><br>
</blockquote>
</div>
<br>
</div>
<div class="gmail_extra"><br>
The problem is that a main module cannot perform relative
imports on Python. To overcome that limitation, Python created
a workaround to execute a module with:<br>
<br>
python -m '<a moz-do-not-send="true" href="http://module.name">module.name</a>'<br>
<br>
</div>
<div class="gmail_extra">So, If you execute Python as:<br>
<br>
</div>
<div class="gmail_extra">python -m PyQt5.uic.pyuic<br>
<br>
</div>
<div class="gmail_extra">
(instead of "python C:\Program
Files\Python\2.5\Lib\site-packages\PyQt5\uic\pyuic.py")<br>
<br>
</div>
<div class="gmail_extra">it should work.<br>
<br>
</div>
<div class="gmail_extra">If you want, you can read an answer on
<a moz-do-not-send="true"
href="http://stackoverflow.com/questions/14132789/python-relative-imports-for-the-billionth-time">http://stackoverflow.com/questions/14132789/python-relative-imports-for-the-billionth-time</a>
for more details on why it doesn't work and the other way
does...<br>
</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">Cheers,<br>
<br>
Fabio<br>
</div>
<div class="gmail_extra"><br>
</div>
</div>
</blockquote>
Thanks Fabio, just what I needed. I've started to read the SO posts
and relevant PEP but my brain is fried (it is 01:45 here) so I'll
have a better read in the morning and 'play' with some modules so
that I properly understand what's going on.<br>
<br>
Regards<br>
<br>
Steve <br>
</body>
</html>
[toc] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2014-05-01 01:50 +0000 |
| Message-ID | <5361a85a$0$29965$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #70794 |
On Thu, 01 May 2014 01:49:25 +0100, Steve Simmons wrote: > <html> > <head> > <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> > </head> > <body bgcolor="#FFFFFF" text="#000000"> > <br> > <div class="moz-cite-prefix">On 30/04/2014 23:49, Fabio Zadrozny > wrote:<br> > </div> > <blockquote > cite="mid:CANXBEFrqndqCeT-9Hgqz7jRCZcmp8nz4VE+ebf-BKsYr54qQqQ > @mail.gmail.com" > type="cite"> And that's about where I stopped reading. I'm sorry Steve, but you're writing to a programmer's forum here, and you should be sending in plain text, not so-called "rich text" (actually HTML code, as you can see). At the very least, if you absolutely must send HTML code, you should instruct your mail program to also send plain text. People are reading this via Usenet and email and possibly using other ways as well. Depending on how they are receiving your post, sending HTML may be considered rude and a breach of etiquette (e.g. text-based news groups typically ban binary attachments, including HTML), or their client may not support HTML, or they may simply choose not to receive or read such posts. (Pure HTML is one of the most reliable signs of spam email.) So I'm afraid that I have no idea what you were trying to say in your post. Manually deciphering the message from the markup was too painful. I'm not likely to be the only one. If you would care to try again using plain text, you may get a better response rate. -- Steven D'Aprano http://import-that.dreamwidth.org/
[toc] | [prev] | [next] | [standalone]
| From | Mark H Harris <harrismh777@gmail.com> |
|---|---|
| Date | 2014-04-30 22:03 -0500 |
| Message-ID | <ljsdih$vvm$2@speranza.aioe.org> |
| In reply to | #70797 |
On 4/30/14 8:50 PM, Steven D'Aprano wrote:
> On Thu, 01 May 2014 01:49:25 +0100, Steve Simmons wrote:
>
>> <html>
>> <head>
>> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
>> </head>
>> <body bgcolor="#FFFFFF" text="#000000">
>> <br>
>> <div class="moz-cite-prefix">On 30/04/2014 23:49, Fabio Zadrozny
>> wrote:<br>
>> </div>
>> <blockquote
>> cite="mid:CANXBEFrqndqCeT-9Hgqz7jRCZcmp8nz4VE+ebf-BKsYr54qQqQ
>> @mail.gmail.com"
>> type="cite">
>
> And that's about where I stopped reading.
Post as quote:
> I'm trying to set up a new dev environment using Windows 7;
> Eclipse (Kepler); Python 3.3; PyDev and PyQt 5 and I've hit an
> issue getting PyUIC to generate a python Qt class from within Eclipse.
>
> I'm using the following setup process (from Google Groups) modified
> to match my PyQt5 configuration:
>
> 1. Click Run -> External Tools -> External Tools Configurations ...
> 2. In the resulting dialog, click 'New' icon in the top left
> 3. Under 'Name' put 'PyUIC'
> 4. Under 'Location' enter 'C:\Program Files\Python\2.5\Python.exe' or
> the path to your Python executable (probably C:\Python25\Python.exe)
> 5. Under 'Arguments' enter '"C:\Program Files\Python\2.5\Lib\site-
> packages\PyQt4\uic\pyuic.py" "${resource_loc}"' substituting the path
> to your PyQt4 installation - be sure also to include the double quotes
> 6. Change to the 'Common' tab and check 'File' under 'Standard Input/
> Output' and enter '${resource_loc}.py'
> 7. Change to the 'Build' tab and uncheck 'Build before launch'
> 8. Change to the 'Refresh' tab and check 'Refresh resources upon
> completion'
> 9. Click 'Apply' then 'Run'
> and I'm getting the following traceback:
> Traceback (most recent call last):
> File "D:\Development\Python33\Lib\site-packages\PyQt5\uic\pyuic.py",
> line 28, in <module>
> from .driver import Driver
> SystemError: Parent module '' not loaded, cannot perform relative import
> I tried this on Qt4 a week or so ago and it worked OK but Qt5 is giving me
> an error message, so I guess I've either mis-transcribed or there's a difference
> in the directory structure betwee PyQt4 & PyQt5.
>
> I'm more interested to learn how to read the traceback (insightfully) and
> track it to the source of the problem, although it would be good to have it working too!!
>
> Steve Simmons
>
> PS Also posted to PyQT list.
Cheers
[toc] | [prev] | [next] | [standalone]
| From | Steve Simmons <square.steve@gmail.com> |
|---|---|
| Date | 2014-05-01 20:18 +0100 |
| Message-ID | <mailman.9634.1398971894.18130.python-list@python.org> |
| In reply to | #70797 |
On 01/05/2014 02:50, Steven D'Aprano wrote: > On Thu, 01 May 2014 01:49:25 +0100, Steve Simmons wrote: > >> <html> >> <head> >> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> >> </head> >> <body bgcolor="#FFFFFF" text="#000000"> >> <br> >> <div class="moz-cite-prefix">On 30/04/2014 23:49, Fabio Zadrozny >> wrote:<br> >> </div> >> <blockquote >> cite="mid:CANXBEFrqndqCeT-9Hgqz7jRCZcmp8nz4VE+ebf-BKsYr54qQqQ >> @mail.gmail.com" >> type="cite"> > And that's about where I stopped reading. > > I'm sorry Steve, but you're writing to a programmer's forum here, and you > should be sending in plain text, not so-called "rich text" (actually HTML > code, as you can see). At the very least, if you absolutely must send > HTML code, you should instruct your mail program to also send plain text. > > People are reading this via Usenet and email and possibly using other > ways as well. Depending on how they are receiving your post, sending HTML > may be considered rude and a breach of etiquette (e.g. text-based news > groups typically ban binary attachments, including HTML), or their client > may not support HTML, or they may simply choose not to receive or read > such posts. (Pure HTML is one of the most reliable signs of spam email.) > > So I'm afraid that I have no idea what you were trying to say in your > post. Manually deciphering the message from the markup was too painful. > I'm not likely to be the only one. If you would care to try again using > plain text, you may get a better response rate. > > > Mea Culpa. Ironic really, the post was to thank Fabio for resolving my problem (posted correctly in plain text) and saying that I was too tired to make the required fix. Obviously too tired to hit 'plain text' instead of 'RTF' in my mail format drop-down too. Anyways, a plain text "Thank you" to Fabio for fixing my issue; a "Thank you" to Mark Harris for putting my encoded text through the transmogrifier and an apology to the rest of the list members. Steve
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web