importing 3rd party stuff before an app starts...

Hi all,

I've found that it doesn't work to import something from wxaddons before initializing an wxApp:

>>> import wx
>>> wx.__version__
'2.8.9.1'
>>> import wxaddons
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/local/lib/wxPython-unicode-2.8.9.1/lib/python2.5/site-packages/wxaddons/__init__.py", line 29, in <module>
     config = wx.Config("wxaddons")
   File "//usr/local/lib/wxPython-unicode-2.8.9.1/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_misc.py", line 3298, in __init__
     _misc_.Config_swiginit(self,_misc_.new_Config(*args, **kwargs))
wx._core.PyNoAppError: The wx.App object must be created first!

This worked in some previuous version, so was this an accident that crept in? Or is there a good reason for it?

I'd like to keep my imports clean, which means importing this kind of thing right up front.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (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

funny, I just posted this, and now there is the enclosed message on the pythonmac list:

Someone is finding the python built-in help crashing due to being unable to import wx.addons -- so this really should get fixed.

-Chris

Gidday
I continue to have problems with python 2.5.1 and python2.4 on OSX 10.5.5
I can't access help() > modules Here is the complete error report for 2.5

geomacbk:~ georgewr$ python
Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> help()

Welcome to Python 2.5! This is the online help utility.

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://www.python.org/doc/tut/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules. To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics". Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".

modules

Please wait a moment while I gather a list of all available modules...

Leopard libedit detected.
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py:110: DeprecationWarning: twisted.flow is unmaintained.
   __import__(name)
/Library/Python/2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.5-i386.egg/twisted/words/im/__init__.py:8: UserWarning: twisted.im will be undergoing a rewrite at some point in the future.
   warnings.warn("twisted.im will be undergoing a rewrite at some point in the future.")
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site.py", line 348, in __call__
     return pydoc.help(*args, **kwds)
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1647, in __call__
     self.interact()
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1665, in interact
     self.help(request)
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1681, in help
     elif request == 'modules': self.listmodules()
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1802, in listmodules
     ModuleScanner().run(callback)
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1853, in run
     for importer, modname, ispkg in pkgutil.walk_packages():
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py", line 110, in walk_packages
     __import__(name)
   File "/usr/local/lib/wxPython-unicode-2.8.9.1/lib/python2.5/site-packages/wxaddons/__init__.py", line 29, in <module>
     config = wx.Config("wxaddons")
   File "//usr/local/lib/wxPython-unicode-2.8.9.1/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_misc.py", line 3298, in __init__
     _misc_.Config_swiginit(self,_misc_.new_Config(*args, **kwargs))
wx._core.PyNoAppError: The wx.App object must be created first!

···

__________________________________

I also have an error on python2.4 help()

modules

Bus error
geomacbk:~ georgewr$
___________________________________

Any assistance appreciated.

George Wright
georgewr@bigpond.net.au
http://mywebsite.bigpond.net.au/georgewr/
http://www.labyrinth.net.au/~gwright

_______________________________________________
Pythonmac-SIG maillist - Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (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

Hi Chris,

wxaddons can be deleted, it's not used any more (the only module in it, sized_controls, has been moved to wx.lib) and if it is still being distributed with wxPython it shouldn't be any longer.

Thanks,

Kevin

···

On Dec 19, 2008, at 4:35 PM, Christopher Barker wrote:

funny, I just posted this, and now there is the enclosed message on the pythonmac list:

Someone is finding the python built-in help crashing due to being unable to import wx.addons -- so this really should get fixed.

-Chris

Gidday
I continue to have problems with python 2.5.1 and python2.4 on OSX 10.5.5
I can't access help() > modules Here is the complete error report for 2.5

geomacbk:~ georgewr$ python
Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> help()

Welcome to Python 2.5! This is the online help utility.

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://www.python.org/doc/tut/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules. To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics". Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".

> modules

Please wait a moment while I gather a list of all available modules...

Leopard libedit detected.
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py:110: DeprecationWarning: twisted.flow is unmaintained.
__import__(name)
/Library/Python/2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.5-i386.egg/twisted/words/im/__init__.py:8: UserWarning: twisted.im will be undergoing a rewrite at some point in the future.
warnings.warn("twisted.im will be undergoing a rewrite at some point in the future.")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site.py", line 348, in __call__
   return pydoc.help(*args, **kwds)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1647, in __call__
   self.interact()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1665, in interact
   self.help(request)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1681, in help
   elif request == 'modules': self.listmodules()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1802, in listmodules
   ModuleScanner().run(callback)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py", line 1853, in run
   for importer, modname, ispkg in pkgutil.walk_packages():
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py", line 110, in walk_packages
   __import__(name)
File "/usr/local/lib/wxPython-unicode-2.8.9.1/lib/python2.5/site-packages/wxaddons/__init__.py", line 29, in <module>
   config = wx.Config("wxaddons")
File "//usr/local/lib/wxPython-unicode-2.8.9.1/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_misc.py", line 3298, in __init__
   _misc_.Config_swiginit(self,_misc_.new_Config(*args, **kwargs))
wx._core.PyNoAppError: The wx.App object must be created first!
>>>
__________________________________

I also have an error on python2.4 help()

> modules
Bus error
geomacbk:~ georgewr$
___________________________________

Any assistance appreciated.

George Wright
georgewr@bigpond.net.au
http://mywebsite.bigpond.net.au/georgewr/
http://www.labyrinth.net.au/~gwright

_______________________________________________
Pythonmac-SIG maillist - Pythonmac-SIG@python.org
Pythonmac-SIG Info Page

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (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
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users