python freeze help

Discussion in 'Python' started by Gabriel Rossetti, Sep 23, 2008.

  1. 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@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

    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
    Gabriel Rossetti, Sep 23, 2008
    #1
    1. Advertising

  2. On Sep 23, 5:01 am, Gabriel Rossetti <>
    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@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.


    >
    > 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
    Mike Driscoll, Sep 23, 2008
    #2
    1. Advertising

  3. Mike Driscoll wrote:
    > On Sep 23, 5:01 am, Gabriel Rossetti <>
    > 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@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
    >
    Gabriel Rossetti, Sep 24, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Aki Niimura

    Python and freeze (something odd)

    Aki Niimura, Jul 9, 2003, in forum: Python
    Replies:
    0
    Views:
    327
    Aki Niimura
    Jul 9, 2003
  2. Tsubasa[Hokage]
    Replies:
    0
    Views:
    494
    Tsubasa[Hokage]
    Jan 26, 2005
  3. Tsubasa[Hokage]
    Replies:
    0
    Views:
    687
    Tsubasa[Hokage]
    Jan 27, 2005
  4. LB
    Replies:
    3
    Views:
    736
    Gabriel Genellina
    Sep 5, 2008
  5. Replies:
    5
    Views:
    251
    Olivier Renaud
    Mar 15, 2007
Loading...

Share This Page