Hi All,
I’ve been working on a python based application for 3
years now. Using Python 2.2, MySQL_Python, and wxPython. Recently some of my
clients have wanted to upgrade to MySQL 5.0 which meant that I had to upgrade
MySQL_Python, Python and most of the other dependencies including wxPython. So
I’ve upgraded to Python 2.4, and wxPython 2.8.0.1. I’m trying to
compile using py2exe 0.6.6 and it compiles without error but when try to run
the application it gives the following error.
Traceback (most recent call last):
File “TIQS.py”, line 15, in ?
File “LoginFrame.pyc”, line 19, in ?
AttributeError: ‘module’ object has no attribute ‘build’
Line 19 is the first executable line of LoginFrame.pyc and
it is:
from wx import *
Any suggestions?
Thanks in advance.
Trevor West
Developer for QA Labs Inc.
It may not be relevant,
but I’ve had some py2exe problems after updating the wxPython version
because I didn’t delete the build directory. I think py2exe doesn’t
recognize the changed version correctly which makes your compiled code
use the wrong version of wxPython.
You might want to try
changing “from wx import *” to “import wx” and adding “wx.” everywhere
it is needed. If that works, at least that will narrow the search a bit.
Trevor West wrote:
···
Hi All,
I’ve been working on a
python based application for 3
years now. Using Python 2.2, MySQL_Python, and wxPython. Recently some
of my
clients have wanted to upgrade to MySQL 5.0 which meant that I had to
upgrade
MySQL_Python, Python and most of the other dependencies including
wxPython. So
I’ve upgraded to Python 2.4, and wxPython 2.8.0.1. I’m trying to
compile using py2exe 0.6.6 and it compiles without error but when try
to run
the application it gives the following error.
Traceback (most recent
call last):
File “TIQS.py”, line
15, in ?
File “LoginFrame.pyc”,
line 19, in ?
AttributeError: ‘module’
object has no attribute ‘build’
Line 19 is the first
executable line of LoginFrame.pyc and
it is:
from wx import *
Any suggestions?
Thanks in advance.
Trevor West
Developer for QA Labs
Inc.
Hi Trevor,
Trevor West wrote:
Hi All,
I’ve been working on a python based application for 3 years now. Using Python 2.2, MySQL_Python, and wxPython. Recently some of my clients have wanted to upgrade to MySQL 5.0 which meant that I had to upgrade MySQL_Python, Python and most of the other dependencies including wxPython. So I’ve upgraded to Python 2.4, and wxPython 2.8.0.1. I’m trying to compile using py2exe 0.6.6 and it compiles without error but when try to run the application it gives the following error.
Traceback (most recent call last):
File "TIQS.py", line 15, in ?
File "LoginFrame.pyc", line 19, in ?
AttributeError: 'module' object has no attribute 'build'
Line 19 is the first executable line of LoginFrame.pyc and it is:
from wx import *
I guess that you upgraded something, e.g. wxPython or py2exe and after it you did not clean out the py2exe build folders. In my setup.py I always do this:
# cleanup dist and build directory first (for new py2exe version)
if os.path.exists("dist/prog"):
shutil.rmtree("dist/prog")
if os.path.exists("dist/lib"):
shutil.rmtree("dist/lib")
if os.path.exists("build"):
shutil.rmtree("build")
I would also change your way of importing wx to "import wx" and change your code to reference all the wx stuff with "wx.".
Werner
Thanks that totally solved it the problem
was fixed when I changed from wx import *.
···
From: Eli Golovinsky [mailto:gooli@tuzig.com]
Sent: Monday, January 15, 2007
2:05 PM
To:
wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users]
Executable built with py2exe fails when I try to run
It may not be relevant,
but I’ve had some py2exe problems after updating the wxPython version because I
didn’t delete the build directory. I think py2exe doesn’t recognize the changed
version correctly which makes your compiled code use the wrong version of
wxPython.
You might want to try
changing “from wx import *” to “import wx” and adding
“wx.” everywhere it is needed. If that works, at least that will
narrow the search a bit.
Trevor West wrote:
Hi All,
I’ve been working on a python based application
for 3 years now. Using Python 2.2, MySQL_Python, and wxPython. Recently some of
my clients have wanted to upgrade to MySQL 5.0 which meant that I had to
upgrade MySQL_Python, Python and most of the other dependencies including wxPython.
So I’ve upgraded to Python 2.4, and wxPython 2.8.0.1. I’m trying to
compile using py2exe 0.6.6 and it compiles without error but when try to run
the application it gives the following error.
Traceback (most recent call last):
File “TIQS.py”, line 15, in ?
File “LoginFrame.pyc”, line 19, in ?
AttributeError: ‘module’ object has no attribute
‘build’
Line 19 is the first executable line of
LoginFrame.pyc and it is:
from wx import *
Any suggestions?
Thanks in advance.
Trevor West
Developer for QA Labs Inc.
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org