Re: Problem packing zope and pkg_resources

78 views
Skip to first unread message

Jerónimo Barraco Mármol

unread,
Oct 5, 2012, 7:21:09 AM10/5/12
to pyins...@googlegroups.com

Thanks!
I solved it by copy the event package into the interface folder, but i dont want to modify the zope library, i want to make it work as expected.

El jueves, 4 de octubre de 2012 11:05:26 UTC-3, Michelle escribió:
I had similar issue:
 got error message: "No module named pkg_resources" 
 on __init__.py which had:
   import__('pkg_resources').declare_namespace(__name__)
I resolved the issue by replacing it with:
  import modulefinder
  for p in __path__:
      modulefinder.AddPackagePath(__name__, p)
Hope it will help you too. 

On Wednesday, October 3, 2012 10:07:33 AM UTC-4, Jerónimo Barraco Mármol wrote:
I'm trying to pack my app which uses zodb.
one of the dependences are zope.interface and zope.event which are distributed in two different eggs.
when i pack the app i get an error saying that zope.event can't be found though is importable.
in my distribution i have:
site-packages/
      zope.interfacexxx.egg/
           zope/
              __init__.py

      zope.eventxxx.egg/
           zope/
              __init__.py 
              event/

and in zope.event.egg/zope/__init__.py it has this line
__import__('pkg_resources').declare_namespace(__name__)
   
i know what is for, i should try to make available the path of zope.event and zope.interface for pyinstaller.
i tried writing a hook but i'm not able to make it work.
when i write a hook for zope (hook-zope.py) pyinstaller picks it up, but when i write one for zope.event (hook-zope.event.py) it never gets called. 
Also i dont know what's the best way to solve this. i've tried reading the other hooks but i'm unsure,
can someone please help me a little?

Hartmut Goebel

unread,
Oct 6, 2012, 5:09:20 AM10/6/12
to pyins...@googlegroups.com
Am 03.10.2012, schrieb Jerónimo Barraco Mármol:

and in zope.event.egg/zope/__init__.py it has this line
__import__('pkg_resources').declare_namespace(__name__)

So what is the exact problem? This sounds as if pkg_resources is missing.

Please provide more information as described in <http://www.pyinstaller.org/wiki/FAQ#IfThingsGoWrong>.


--
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-09-kommerz-uber-recht-fdp-die-gefaellt-mir-partei
Blog: http://www.goebel-consult.de/blog/200505010

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

Jerónimo Barraco Mármol

unread,
Oct 10, 2012, 9:36:32 AM10/10/12
to pyins...@googlegroups.com
Like i've said in my first post, pyinstaller gets confused when a package use pkg_resources because it mixes two paths in one namespace. so it shares the "zope" namespace for zope.interface and zope.event even though they are in different folders..
and pyinstaller simply cant find one of those, because it only has one path of the two.
i tried writing a hook but pyinstaller doesnt pick it up.
Reply all
Reply to author
Forward
0 new messages