Hello:
I made this query on the SPE mailing list first where Stani suggested that I post here. He suggests, and the tests seem to indicate that there is a problem with my wxPython installation causing the problems I am having with SPE.
My problem is that wxGlade and XRCed will not launch from within SPE. The error messages imply that there should be a subdirectory ...wxPython\wx for the package import. At the end of this message I have attached an ascii representation of the directory tree for the the wxPython installation in the site-packages directory of the python installation. Does this make any sense or help?
Does anyone have any ideas or experience with this problem?
Thanks
Lawrence Gray:
SPE Stani's Python Editor wrote:
1) Try to execute at the Python shell:
>>> from wxPython.wx import *
If this gives an error, then probably something is wrong with your wxPython installation or with your uninstallation of previous versions. So you better ask this on the wxpython-user mailing list. SPE itself doesn't have this problem as it always uses 'import wx'.
Done. The same error still occurs (ImportError: No module named wx). I removed the current 2.6.1 version and found a 2.3.5 version that I also removed. I resintalled the 2.6.1 version again. The same error still occurs. I downloaded a new copy of the win installer for wxPython2.6.1 and installed that to no avail. The installation does not create a subdirectory '...wxPython\wx....'
2) wxGlade and XRCed are seperate tools from SPE. To proove that is not a problem of SPE you can try to go to:
Windows Start Menu > Programs > WxPython2.6 Doc Demos and Tools > Resource Editor
Does this start up? If it doesn't something is clearly wrong with your wxPython installation. This is XRCed that SPE also calls.
No, the resource editor does not start up even after all the resintallations.
Can you verify these two issues?
Stani
Thanks for your help. I will pass this on to the wx-python mailing list as suggested.
Lawrence Gray
I have waited for SPE0.8.0a, downloaded and installed the windows
version and have the same problem I had with SPE0.7.5.f.
When i try to activate wxGlade via Tools->Design a gui with
wxGlade.., I
get no response except the following errors
Traceback (most recent call last):
File
"C:\Python24\lib\SITE-P~1\_spe\plugins\wxGlade\wxglade.py",
line 148, in
?
run_main()
File
"C:\Python24\lib\SITE-P~1\_spe\plugins\wxGlade\wxglade.py",
line 135, in
run_main
import main
File
"C:\Python24\Lib\site-packages\_spe\plugins\wxGlade\main.py",
line 9, in
?
from wxPython.wx import *
ImportError: No module named wx
Also; when I try to run Tools->Design a GUI with XRC..., I get no
response except for the following errors
Traceback (most recent call last):
File
"C:\Python24\Lib\site-packages\wx-
2.6-msw-ansi\wx\tools\XRCed\xrced.py",
line 24, in ?
from globals import *
File
"C:\Python24\Lib\site-packages\wx-2.6-msw-ansi\wx\tools\XRCed\globals.py"
, line 7, in ?
from wxPython.wx import *
ImportError: No module named wx
wxPython2.6.1 is installed and works in conjunction with other
applications.
Using Python 2.4.1 on XP-SP2
I have also experienced the same application error that Gregorius
indicated, but I don't have the specifics at this moment.
Any suggestions on how to proceed?
*Thanks Lawrence Gray*
_______________________________________________
Python-spe-users mailing list
Python-spe-users@lists.berlios.de
<mailto:Python-spe-users@lists.berlios.de>
http://lists.berlios.de/mailman/listinfo/python-spe-users
--
http://pythonide.stani.be
http://pythonide.stani.be/manual/html/manual.html
\---wx-2.6-msw-ansi
+---wx
> +---build
> +---lib
> > +---colourchooser
> > +---editor
> > +---mixins
> > +---masked
> > +---ogl
> > \---floatcanvas
> +---py
> > \---tests
> +---tools
> > \---XRCed
> > \---src-images
> \---locale
> +---
>
+---wxPython
> +---lib
> > +---colourchooser
> > +---editor
> > \---mixins
> \---tools
\---docs
\---licence
Lawrence Gray wrote:
The error messages imply that there should be a subdirectory ...wxPython\wx for the package import.
that's the old layout. It's been deprecated for many versions, though may have been there until recently for backward compatibility.
1) Try to execute at the Python shell:
>>> from wxPython.wx import *
this shouldn't work with a new install. This should:
from wx import *
though you should NEVER user that. Instead, use:
import wx
But if you're running someone else's code, then you're stuck with what they've done, as ill-advised as it may be. I'd be surprised if current versions of either SPE or wxGlade use the import * style, but it won't be the first time I've been surprised!
SPE itself doesn't have this problem as it always uses 'import wx'.
Ah, I see at least SPE doesn't!
your wxPython installation. This is XRCed that SPE also calls.
I'm guessing an old XRCed install?
\---wx-2.6-msw-ansi
<snip> looks good to me.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
Chris Barker wrote:
Lawrence Gray wrote:
The error messages imply that there should be a subdirectory ...wxPython\wx for the package import.
that's the old layout. It's been deprecated for many versions, though may have been there until recently for backward compatibility.
1) Try to execute at the Python shell:
>>> from wxPython.wx import *
this shouldn't work with a new install. This should:
from wx import *
though you should NEVER user that. Instead, use:
import wx
But if you're running someone else's code, then you're stuck with what they've done, as ill-advised as it may be. I'd be surprised if current versions of either SPE or wxGlade use the import * style, but it won't be the first time I've been surprised!
I agree with all your sentiments and I have tried altering the offending modules indicated in the tracebacks in the manner you suggested. It created many more problems that I would have to track down. This is the current version of SPE that I am working with and the wxGlade is builtin to the installation file.
I downloaded the most current wxGlade and installed that independent of SPE and that works fine.
SPE itself doesn't have this problem as it always uses 'import wx'.
Ah, I see at least SPE doesn't!
your wxPython installation. This is XRCed that SPE also calls.
I'm guessing an old XRCed install?
Again, I thought that this might be part of the SPE or wxPython intallation both of which are current. I have removed and reinstalled everything and downloaded fresh copies of everything on the chance that some file is corrupted. And I see that a new revision to SPE has been released, so I'll give that a try.
\---wx-2.6-msw-ansi
<snip> looks good to me.
-Chris
I am fairly new at using Python and have been involved only since Python 2.3.5. I am grateful for your analysis of the situation and the assistance of a prolific participant in this mailing list such as yourself.
Thanks Chris
Lawrence Gray
Lawrence Gray wrote:
I agree with all your sentiments and I have tried altering the offending modules indicated in the tracebacks in the manner you suggested. It created many more problems that I would have to track down.
Well, it would be a pretty big project to modernize the code. Very big if you're not familiar with it!
This is the current version of SPE that I am working with and the wxGlade is builtin to the installation file.
I downloaded the most current wxGlade and installed that independent of SPE and that works fine.
It sounds like SPE has included an old wxGlade. Is there a reason you can't just use the new one you installed yourself?
And I see that a new revision to SPE has been released, so I'll give that a try.
good luck.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
Hello:
I have solved the issue of running wxGlade and XRCed from within SPE.
The problem was of my own making. :-[ I hope that this note will prevent
others from falling into the same trap.
Operating on a windows system with XP, I utilize the enviromental
variable 'PYTHONPATH' to point to my working python directory containing
a subdirectory that is a repository of wxPython tools. My error was that
the subdirectory for this repository was named wxPython. My
understanding is that python searches all directories listed in the
'PYTHONPATH' variable before the standard library directories where
packages are installed. My configuration therefore subverted the normal
search path that the SPE application expected. After renaming the
subdirectory to wxPy_Tools, the problems within SPE disappeared.
Thank you again for your time considering my problem.
Lawrence Gray