Hi there,
    I have an python application and and  got no problem with py2exe under python2.4.  It works fine also if I start it by "c:\python25\python main_sps_all02.py". But after I compiled it with py2exe in python2.5, main_sps_all02.exe can not  "import" my modules anymore such as
 
      from SiteConfig.SiteConfig import IP, PORT, QUEUE_SIZE
      from bop.Exceptions import getException
      from bop.Logger import logMessage
      ....
Anybody knows what is going on with py2exe in python2.5?   Thanks for your help in advance.
 
My application file system, main_sps_all02.py and py2exe's setup.py are attached below.   
      # c:/xbop_sinopec
      #    __init__.py
      #    bin/
      #       __init__.py
      #       SSS/
      #          __init__.py
      #          main_sps_all02.py  #"current module"
      #          Python25/
      #              __init__.py
      #              main_sps_all02.exe  # binary file after py2exe "compiled" main_sps.py
      #    bop/
      #        __init__.py
      #        Exceptions.py
      #        Logger.py
      #        SessionManager.py
      #        ...
      #        db/
      #            __init__.py
      #            DatabaseManager.py
      #  SiteConfig/
      #        __init__.py
      #        SiteConfig.py
      # ....
 
######### main_sps_all02.py #################
#!c:/python25/python.exe
## -*- coding: utf-8 -*-
import threading
import os,sys

class ThreadTwo ( threading.Thread ):
   def run (self):
      xbopHome = "C:\\xbop_sinopec"
      sys.path.insert(0, xbopHome)
      from SiteConfig.SiteConfig import IP, PORT, QUEUE_SIZE
      from bop.Exceptions import getException
      from bop.Logger import logMessage
     
      from bop.db.DatabaseManager import databaseManager
      from bop.SessionManager import SessionManager
      from bop.Server import Server
     
      sessionManager = SessionManager()
      sessionManager._state_lock_ = 0
      f = open(os.path.join(xbopHome, 'pid'), 'w')
      f.write(`os.getpid()`)
      f.close()
      server = Server(sessionManager, IP, PORT, QUEUE_SIZE)
      server.start()
if __name__=="__main__":
   xbopThread = ThreadTwo()
   xbopThread.start()
 
 
 
##### py2exe setup.py #######################################
 
from distutils.core import setup
import py2exe
import sys
import glob
from distutils.filelist import findall
import os
import matplotlib
matplotlibdatadir = matplotlib.get_data_path()
matplotlibdata = findall(matplotlibdatadir)
matplotlibdata_files = []
for f in matplotlibdata:
    dirname = os.path.join('matplotlibdata', f[len(matplotlibdatadir)+1:])
    matplotlibdata_files.append((os.path.split(dirname)[0], [f]))
excludes = ["pywin.debugger", "pywin.debugger.dbgcon",
            "pywin.dialogs", "pywin.dialogs.list",'_gtkagg', '_tkagg'] #, "win32com.client"]
includes=['aifc','anydbm','asynchat','asyncore','atexit','audiodev','base64','BaseHTTPServer','Bastion','bdb',
'binhex','bisect','bsddb','bsddb.*','calendar','cgi','CGIHTTPServer','cgitb','chunk','cmd',
'code','codecs','codeop','colorsys','commands','compileall','compiler','compiler.*','ConfigParser','Cookie',
'cookielib','copy','copy_reg','csv','curses','curses.*','dbhash','decimal','difflib','dircache',
'dis','distutils','distutils.*','doctest','DocXMLRPCServer','dumbdbm','dummy_thread','dummy_threading','email','email.*',
'encodings','encodings.*','filecmp','fileinput','fnmatch','formatter','fpformat','ftplib','getopt','getpass',
'gettext','glob','gopherlib','gzip','heapq','hmac','hotshot','hotshot.*','htmlentitydefs','htmllib',
'HTMLParser','httplib','idlelib','idlelib.*','ihooks','imaplib','imghdr','imputil','inspect','keyword',
'linecache','locale','logging','logging.*','macpath','macurl2path',
'mailbox','mailcap','markupbase','mhlib','mimetools','mimetypes','MimeWriter','mimify','modulefinder','multifile',
'mutex','netrc','new','nntplib','ntpath','nturl2path','opcode','optparse','os','os2emxpath',
'pdb','pickle','pickletools','pipes','pkgutil','platform','popen2','poplib','posixfile','posixpath',
'pprint','profile','pstats','pty','pyclbr','pydoc','py_compile','Queue','quopri','random',
're','repr','rexec','rfc822','rlcompleter','robotparser','sched',
'sets','sgmllib','shelve','shlex','shutil','SimpleHTTPServer','SimpleXMLRPCServer','site',
'smtpd','smtplib','sndhdr','socket','SocketServer','sre','sre_compile','sre_constants','sre_parse',
'stat','statvfs','string','StringIO','stringold','stringprep','subprocess','sunau','sunaudio',
'symbol','symtable','tabnanny','tarfile','telnetlib','tempfile','textwrap','this',
'threading','timeit','toaiff','token','tokenize','trace','traceback','tty','types',
'unittest','urllib','urllib2','urlparse','user','UserDict','UserList','UserString','uu','warnings',
'wave','weakref','webbrowser','whichdb','xdrlib','xml','xml.*','xmllib','xmlrpclib',
'zipfile','_LWPCookieJar','_MozillaCookieJar','_strptime','_threading_local','__future__']
packages=['pyodbc','pyExcelerator','ctypes','serial','matplotlib','numpy','pytz']
options = {
    "ascii": 1, # to make a smaller executable, don't include the encodings
    "compressed": 0, # compress the library archive
    "skip_archive": 1,
    "excludes": excludes, # COM stuff we don't want
    'dll_excludes': ['libgdk-win32-2.0-0.dll','libgobject-2.0-0.dll','libgdk_pixbuf-2.0-0.dll','wxmsw26uh_vc.dll','python22.dll','tk83.dll','tcl83.dll'],
    "includes": includes,
    "packages": packages,
    "dist_dir": "Python25",
    }
setup(
      name='xbop',
      version='1.0',
      description='wisco point monitoring',
      author='zxo102',
      author_email='yyy@gmail.com',
      url='http://xbop.objectis.net/',
      console=['main_sps_all02.py'],
    options = {"py2exe": options},
    data_files=matplotlibdata_files
    )