From: Drake S. <dra...@ad...> - 2004-09-09 10:59:49
|
At 08:22 AM 9/9/2004 +0200, Thomas Heller wrote: >Drake Smith <dra...@ad...> writes: > > > Dear py2exe users: > > > > I seem to be missing some fundamental concept in the installation & > > use of python modules. I downloaded and executed > > py2exe-0.5.3.win32-py2.3.exe and it appears to have installed several > > files and directories under ...\site-packages\py2exe. However, there > > is no "py2exe.py" module present. So when I try to run any of the > > samples, I get a message "no module py2exe". I search my entire python > > path and there is no py2exe.py/pyc/pyo file there. Can anyone please > > tell this spoiled Windows/Installshield user of 20 years where I am > > going wrong? Thank you. > >py2exe is a package, so 'import py2exe' gives you the __init__.py file >in the lib\site-packages\py2exe: > >Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32 >Type "help", "copyright", "credits" or "license" for more information. > >>> import py2exe > >>> py2exe ><module 'py2exe' from 'c:\python23\lib\site-packages\py2exe\__init__.pyc'> > >>> > >Thomas Thank you Thomas. The fact that py2exe is a package *is* a fundamental concept! I promise to study the distutils documentation more carefully. In the meantime, though, I still can't get your simple example to build. Here is what I get: C:\Utility\Python\Lib\site-packages\Py2exe\samples\simple>python Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', 'c:\\utility\\python\\lib\\site-packages', 'C:\\WINNT\\system32\\python23.z ip', 'C:\\Utility\\Python\\Lib\\site-packages\\Py2exe\\samples\\simple', 'c:\\ut ility\\python\\DLLs', 'c:\\utility\\python\\lib', 'c:\\utility\\python\\lib\\pla t-win', 'c:\\utility\\python\\lib\\lib-tk', 'c:\\utility\\python', 'C:\\Utility\ \Python\\Lib\\site-packages\\win32', 'C:\\Utility\\Python\\Lib\\site-packages\\w in32\\lib', 'C:\\Utility\\Python\\Lib\\site-packages\\Pythonwin'] >>> import py2exe Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named py2exe >>> I believe I have all the proper directories in my path yet Python still cannot find the py2exe package. Perhaps the root of my problem is that I installed Python in a non-standard directory: c:\utility\python rather than c:\python23. I have had nothing but problems installing other modules/packages. --Drake |