Pyinstaller can't handle namespace packages correctly, such as zope.interface

1,405 views
Skip to first unread message

Victor Lin

unread,
Jan 7, 2012, 11:05:08 PM1/7/12
to PyInstaller
I am using pyinstaller1.5.1 to trying to package my project, and I
noticed that zope.interface is not imported correctly

W: no module named zope.interface (top-level import by
twisted.internet._threadedselect)

After tracing the code, I notice that the way pyinstaller treat
namespace package is wrong. zope.interface uses namespace package,
they shares zope package name but they are in different path. I have
another zope module named "zope.sqlalchemy" installed in my python
environment. As result, mf.py find zope directory of zope.sqlalchemy
at first

C:\Python27\Lib\site-packages\zope.sqlalchemy-0.7-py2.7.egg\zope

then use the wrong path for looking the "interface" folder. Of course,
it does not exist

C:\Python27\Lib\site-packages\zope.sqlalchemy-0.7-py2.7.egg\zope
\interface

I think this is kind of bug. Is there any workaround I can use now? Of
is this problem already fixed in trunk?

Thanks.
Victor Lin.






David Ripton

unread,
Jan 28, 2012, 11:53:01 PM1/28/12
to PyInstaller
It's still a problem as of the latest PyInstaller on Git.

The workaround for zope.interface is to drop a zero-byte __init__.py
into the zope/ directory.

Hartmut Goebel

unread,
Feb 2, 2012, 11:31:00 AM2/2/12
to pyins...@googlegroups.com
Am 29.01.2012 05:53, schrieb David Ripton:
> It's still a problem as of the latest PyInstaller on Git.
>
> The workaround for zope.interface is to drop a zero-byte __init__.py
> into the zope/ directory.

Can you please open a ticket for this bug, stating both the problem and
the solution there. Thanks, this make sure it does not get lost.

Maybe you want to hack PyInstaller to fix it?

--
Schönen Gruß - Regards
Hartmut Goebel
Dipl.-Informatiker (univ.), CISSP, CSSLP

Goebel Consult
Spezialist für IT-Sicherheit in komplexen Umgebungen
http://www.goebel-consult.de

Monatliche Kolumne: http://www.cissp-gefluester.de/
Goebel Consult ist Mitglied bei http://www.7-it.de


David Ripton

unread,
Feb 2, 2012, 9:15:55 PM2/2/12
to PyInstaller
On Feb 2, 11:31 am, Hartmut Goebel <h.goe...@goebel-consult.de> wrote:
> Am 29.01.2012 05:53, schrieb David Ripton:
>
> > It's still a problem as of the latest PyInstaller on Git.
>
> > The workaround for zope.interface is to drop a zero-byte __init__.py
> > into the zope/ directory.
>
> Can you please open a ticket for this bug, stating both the problem and
> the solution there. Thanks, this make sure it does not get lost.

I added a ticket.

j_vinegar

unread,
Jul 19, 2012, 10:27:34 AM7/19/12
to pyins...@googlegroups.com
Il giorno giovedì 2 febbraio 2012 21:15:55 UTC-5, David Ripton ha scritto:
On Feb 2, 11:31 am, Hartmut Goebel <h.goe...@goebel-consult.de> wrote:
> Am 29.01.2012 05:53, schrieb David Ripton:
>
> > It's still a problem as of the latest PyInstaller on Git.
>
> > The workaround for zope.interface is to drop a zero-byte __init__.py
> > into the zope/ directory.

The workaround seems not to work for me, in the log I still get:

W: no module named zope.interface.implements (top-level import by twisted.internet.abstract)

any other ideas or workaorunds?
thanks
Joe

my setup:

ubuntu 12.04LTS
pyInstaller git commit c6d550
zope.interface (installed as .deb from ubuntu repository, package version 3.6.1-1ubuntu3)
python 2.7

 

Hartmut Goebel

unread,
Jul 19, 2012, 2:28:18 PM7/19/12
to pyins...@googlegroups.com
Am 19.07.2012 16:27, schrieb j_vinegar:
W: no module named zope.interface.implements (top-level import by twisted.internet.abstract)

any other ideas or workaorunds?
thanks
Joe

my setup:

ubuntu 12.04LTS
pyInstaller git commit c6d550


Please use the current development version for the development branch. There have been lots of enhancements since 1.5.1


--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP

Goebel Consult
http://www.goebel-consult.de

Monatliche Kolumne: http://www.cissp-gefluester.de/2011-10-aus-der-schublade-in-die-koepfe
Blog: http://www.goebel-consult.de/blog/20050620

Goebel Consult ist Mitglied bei http://www.7-it.de/

j_vinegar

unread,
Jul 19, 2012, 3:56:16 PM7/19/12
to pyins...@googlegroups.com


Il giorno giovedì 19 luglio 2012 14:28:18 UTC-4, Hartmut Goebel ha scritto:
Am 19.07.2012 16:27, schrieb j_vinegar:
W: no module named zope.interface.implements (top-level import by twisted.internet.abstract)

any other ideas or workaorunds?
thanks
Joe

my setup:

ubuntu 12.04LTS
pyInstaller git commit c6d550


Please use the current development version for the development branch. There have been lots of enhancements since 1.5.1

I see that appending my question to a 1.5.1-related issue has probably mislead you:
as I've reported, I'm using commit c6d550,  the freshly pulled last *development* version.
I did that in good faith because it seems the same problem, sorry for that.

thanks for the quick reply anyway.

and, the problem is still here :)
Joe

j_vinegar

unread,
Jul 19, 2012, 5:06:22 PM7/19/12
to pyins...@googlegroups.com

W: no module named zope.interface.implements (top-level import by twisted.internet.abstract)

a few more info:
new setup, using virtualenv and installing zope with pip, not from .deb package:

initially iu.py aborts with Import error "No module named zope"

once done the workaround ( empty __init__.py in ENV/lib/python2.7/site-packages/zope )
the EXE runs, but doesn't work properly. The first warning in pyinstaller log are still:


W: no module named zope.interface.implements (top-level import by twisted.internet.abstract)

so, is it a different beast, or just the same bug in a different incarnation?
Thanks,
Joe

Hartmut Goebel

unread,
Jul 20, 2012, 2:50:26 AM7/20/12
to pyins...@googlegroups.com
Am 19.07.2012 23:06, schrieb j_vinegar:

W: no module named zope.interface.implements (top-level import by twisted.internet.abstract)

Please make sure you are really using the current development version of PyInstaller. This log-message has the format, 1.5.1 used. The format for current dev is '%(relativeCreated)d %(levelname)s: %(message)s' for quite some time now.

Please do not install the developer snapshot into the same directory as 1.5.1.

If this does not help, the best would be to build a minimalistic app and a minimalistic setup-shell script (or paster) we can just cut-and-past to reproduce the problem. As you already are using pip and virtuel-env, it should be easey once we have this files.


--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP

Goebel Consult
http://www.goebel-consult.de

j_vinegar

unread,
Jul 20, 2012, 7:38:24 PM7/20/12
to pyins...@googlegroups.com
Il giorno venerdì 20 luglio 2012 02:50:26 UTC-4, Hartmut Goebel ha scritto:
Am 19.07.2012 23:06, schrieb j_vinegar:

W: no module named zope.interface.implements (top-level import by twisted.internet.abstract)

Please make sure you are really using the current development version of PyInstaller. This log-message has the format, 1.5.1 used. The format for current dev is '%(relativeCreated)d %(levelname)s: %(message)s' for quite some time now.

Please do not install the developer snapshot into the same directory as 1.5.1.

I did use the development tar.gz on the homepage. same result.

If this does not help, the best would be to build a minimalistic app and a minimalistic setup-shell script (or paster) we can just cut-and-past to reproduce the problem. As you already are using pip and virtuel-env, it should be easey once we have this files.

I would love to but unfortunately I'm quite new to python and the codebase I'm trying to pack is not mine and a bit complex, but it is floss:
https://gitweb.torproject.org/ooni-probe.git

maybe you can try directly and at least confirm the problem?
thanks
Joe

Reply all
Reply to author
Forward
0 new messages