From: Tim v. d. L. <tn...@gm...> - 2008-05-26 12:53:24
|
Hi Teja, I ran into this problem too a while ago and found the following code on the web after someone directed me to query Google in the right way... ---begin code--- # ModuleFinder can't handle runtime changes to __path__, but win32com uses them try: # if this doesn't work, try import modulefinder import py2exe.mf as modulefinder import win32com for p in win32com.__path__[1:]: modulefinder.AddPackagePath("win32com", p) for extra in ["win32com.shell"]: #,"win32com.mapi" __import__(extra) m = sys.modules[extra] for p in m.__path__[1:]: modulefinder.AddPackagePath(extra, p) except ImportError: # no build path setup, no worries. pass ---end code--- Add that somewhere to the top of your setup.py (in mine, it is just before importing setup from distutils.core and py2exe, but just after importing time and sys). Cheers and much luck with it, --Tim On Mon, May 26, 2008 at 2:39 PM, Tejovathi P <tej...@gm...> wrote: > Hi Norm.. > > Thanks for your reply,.. I tried to include the win32com package using > "includes" option as well as "package" option. But still > the same error reappears " Import error: No module named shell" !! > > Any pointers???? > > -Teja > > > > > On 5/23/08, Norm Petterson <nj...@nj...> wrote: >> >> >> >> On Fri, May 23, 2008 at 8:18 AM, Tejovathi P <tej...@gm...> >> wrote: >> >>> >>> >>> I opened pythonwin and tried importing wincom.shell. Its working >>> fine.....!!!!! Then where am I doing wrong.... >>> >>> >> >> Hello Tejovathi, >> >> Googling py2exe win32com gave this reference among the first few: >> >> http://www.wiredfool.com/2006/11/18/python-and-com-components/ >> >> containing this clue: >> >> *The final wrinkle in this exercise is packaging using py2exe. Win32com >> needs to be added as a package in the setup.py, >> >> *HTH, >> >> Norm >> >> >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Py2exe-users mailing list > Py2...@li... > https://lists.sourceforge.net/lists/listinfo/py2exe-users > > |