python freeze help

Gabriel Rossetti gabriel.rossetti at arimaz.com
Wed Sep 24 08:22:51 CEST 2008


Mike Driscoll wrote:
> On Sep 23, 5:01 am, Gabriel Rossetti <gabriel.rosse... at arimaz.com>
> wrote:
>   
>> Hello everyone,
>>
>> I'm trying to use python's freeze utility but I'm running into problems.
>> I called it like this :
>>
>> python /usr/share/doc/python2.5/examples/Tools/freeze/freeze.py
>> ~/Documents/Code/Python/src/jester/service.py -m jester
>>
>> then I did : make
>>
>> then I tried to run it : ./service
>>
>> and I get this :
>>
>> grossetti at desktop-01:~/tmp/freeze$ ./service
>> Traceback (most recent call last):
>>   File "/home/grossetti/Documents/Code/Python/src/jester/service.py",
>> line 16, in <module>
>>     from jester import constants, utils
>>   File "/home/grossetti/Documents/Code/Python/src/jester/utils.py", line
>> 20, in <module>
>>     from twisted.internet.protocol import Protocol, ClientCreator
>>   File "/usr/lib/python2.5/site-packages/twisted/internet/protocol.py",
>> line 17, in <module>
>>     from zope.interface import implements
>>   File "/usr/lib/python2.5/site-packages/zope/__init__.py", line 20, in
>> <module>
>>     pkg_resources.declare_namespace('zope')
>>   File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1749,
>> in declare_namespace
>>     _handle_ns(packageName, path_item)
>>   File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1719,
>> in _handle_ns
>>     path = module.__path__; path.append(subpath)
>> AttributeError: 'str' object has no attribute 'append'
>> Error in sys.excepthook:
>> Traceback (most recent call last):
>>   File "/usr/lib/python2.5/site-packages/apport_python_hook.py", line
>> 38, in apport_excepthook
>>     from apport.packaging_impl import impl as packaging
>>   File "/usr/lib/python2.5/site-packages/apport/__init__.py", line 1, in
>> <module>
>>     from apport.report import Report
>>   File "/usr/lib/python2.5/site-packages/apport/report.py", line 20, in
>> <module>
>>     from problem_report import ProblemReport
>>   File "/usr/lib/python2.5/site-packages/problem_report.py", line 18, in
>> <module>
>>     from email.MIMEMultipart import MIMEMultipart
>>   File "/usr/lib/python2.5/email/__init__.py", line 79, in __getattr__
>>     __import__(self.__name__)
>> ImportError: No module named multipart
>>     
>
>
> I've gotten this error from py2exe before. I'm not sure how freeze
> works, but in py2exe I had to make sure the email package wasn't being
> accidentally excluded and explicitly included.
>
>
>   
I tried that (-m email), didn't work, I added -E and I get this :

There are some missing modules: ['Carbon.File', 'Carbon.Folder', 
'Carbon.Folders', 'EasyDialogs', 'FCNTL', 'MacOS', 'SOCKS', 
'_dummy_threading', '_emx_link', '_md5', '_sha', '_sha256', '_sha512', 
'_subprocess', '_winreg', '_xmlplus', 'ce', 'email.Encoders', 
'email.Generator', 'email.Iterators', 'email.MIMEBase', 
'email.MIMEMultipart', 'email.MIMEText', 'email.Utils', 'gestalt', 'ic', 
'java.lang', 'mac', 'msvcrt', 'nt', 'org.python.core', 'os.path', 'os2', 
'pywintypes', 'riscos', 'riscosenviron', 'riscospath', 'rourl2path', 
'sgi', 'win32api', 'win32con', 'win32event', 'win32file', 'win32pipe', 
'win32process', 'win32security']

so I tried to see if it existed :

 >>> import email
 >>> email.MIMEMultipart
<email.LazyImporter object at 0xb7d6a62c>
 >>>

maybe this is the problem, an email.MIMEMultipart object isn't what is 
returned but instead an email.LazyImporter object is, so freeze isn't 
happy... any ideas on how to solve this?

>> Original exception was:
>> Traceback (most recent call last):
>>   File "/home/grossetti/Documents/Code/Python/src/jester/service.py",
>> line 16, in <module>
>>     from jester import constants, utils
>>   File "/home/grossetti/Documents/Code/Python/src/jester/utils.py", line
>> 20, in <module>
>>     from twisted.internet.protocol import Protocol, ClientCreator
>>   File "/usr/lib/python2.5/site-packages/twisted/internet/protocol.py",
>> line 17, in <module>
>>     from zope.interface import implements
>>   File "/usr/lib/python2.5/site-packages/zope/__init__.py", line 20, in
>> <module>
>>     pkg_resources.declare_namespace('zope')
>>   File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1749,
>> in declare_namespace
>>     _handle_ns(packageName, path_item)
>>   File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1719,
>> in _handle_ns
>>     path = module.__path__; path.append(subpath)
>> AttributeError: 'str' object has no attribute 'append'
>>
>> Does anyone have any ideas as of why I get this?
>>
>> Thank you,
>> Gabriel
>>     
>
> I don't know what this second error is...
>
> Mike
> --
> http://mail.python.org/mailman/listinfo/python-list
>   



More information about the Python-list mailing list