error with wxPython2.8-win32-unicode-2.8.7.1-py25.exe

E

Emmanuel

I recently upgraded wxpython (and python) on XP using wxPython2.8-
win32-unicode-2.8.7.1-py25.exe

Now when I run

from wxPython.wx import *

It crashes :

-> import _wx
...

from _misc import *

....

--> 456 wxDateTime_GetNumberOfDaysinYear =
wx._misc.DateTime_GetNumberOfDaysinYear

....

AtributeError: 'module' object has no atribute
'DateTime_GetNumberOfDaysinYear'

Is it a known problem or is there something wrong only on my side?
 
E

Emmanuel

I switched back to wxPython2.6 and with wxPython2.6-win32-
unicode-2.6.4.0-py25.exe
this problem mentionned eariler does not occur.
 
E

Enrico

Emmanuel said:
I recently upgraded wxpython (and python) on XP using wxPython2.8-
win32-unicode-2.8.7.1-py25.exe

Now when I run

from wxPython.wx import *

It crashes :

Warning (from warnings module):
File "__main__", line 1
DeprecationWarning: The wxPython compatibility package is no longer
automatically generated or actively maintained. Please switch to the wx
package as soon as possible.

I suggest you to try(I don't think that importing everything is a good choice)

Enrico
 
K

kyosohma

I recently upgraded wxpython (and python) on XP using wxPython2.8-
win32-unicode-2.8.7.1-py25.exe

Now when I run

from wxPython.wx import *

It crashes :

-> import _wx
...

from _misc import *

...

--> 456 wxDateTime_GetNumberOfDaysinYear =
wx._misc.DateTime_GetNumberOfDaysinYear

...

AtributeError: 'module' object has no atribute
'DateTime_GetNumberOfDaysinYear'

Is it a known problem or is there something wrong only on my side?

The newer versions of wx are not supposed to be imported in this way:

from wx import *

The current correct way is to just import wx. I am not sure when this
was started, but it was more than a year ago.

Most of the time, from package import * is NOT recommended as it can
unintended consequences, such as poisoning the namespace. For example,
if you did this with a package that contained an object called "foo"
and you did this:

foo = 2

Then you just reassigned the foo that was imported.

HTH

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top