{"action":"created","issue":{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/615","labels_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/615/labels{/name}","comments_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/615/comments","events_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/615/events","html_url":"https://github.com/pyinstaller/pyinstaller/issues/615","id":46176640,"number":615,"title":"problems finding module zope","user":{"login":"pyinstaller-tickets-migration","id":5377465,"avatar_url":"https://avatars.githubusercontent.com/u/5377465?v=3","gravatar_id":"","url":"https://api.github.com/users/pyinstaller-tickets-migration","html_url":"https://github.com/pyinstaller-tickets-migration","followers_url":"https://api.github.com/users/pyinstaller-tickets-migration/followers","following_url":"https://api.github.com/users/pyinstaller-tickets-migration/following{/other_user}","gists_url":"https://api.github.com/users/pyinstaller-tickets-migration/gists{/gist_id}","starred_url":"https://api.github.com/users/pyinstaller-tickets-migration/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyinstaller-tickets-migration/subscriptions","organizations_url":"https://api.github.com/users/pyinstaller-tickets-migration/orgs","repos_url":"https://api.github.com/users/pyinstaller-tickets-migration/repos","events_url":"https://api.github.com/users/pyinstaller-tickets-migration/events{/privacy}","received_events_url":"https://api.github.com/users/pyinstaller-tickets-migration/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/labels/@high","name":"@high","color":"e11d21"},{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/labels/v2.0","name":"v2.0","color":"ededed"}],"state":"closed","locked":false,"assignee":{"login":"pyinstaller-tickets-migration","id":5377465,"avatar_url":"https://avatars.githubusercontent.com/u/5377465?v=3","gravatar_id":"","url":"https://api.github.com/users/pyinstaller-tickets-migration","html_url":"https://github.com/pyinstaller-tickets-migration","followers_url":"https://api.github.com/users/pyinstaller-tickets-migration/followers","following_url":"https://api.github.com/users/pyinstaller-tickets-migration/following{/other_user}","gists_url":"https://api.github.com/users/pyinstaller-tickets-migration/gists{/gist_id}","starred_url":"https://api.github.com/users/pyinstaller-tickets-migration/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyinstaller-tickets-migration/subscriptions","organizations_url":"https://api.github.com/users/pyinstaller-tickets-migration/orgs","repos_url":"https://api.github.com/users/pyinstaller-tickets-migration/repos","events_url":"https://api.github.com/users/pyinstaller-tickets-migration/events{/privacy}","received_events_url":"https://api.github.com/users/pyinstaller-tickets-migration/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/milestones/9","html_url":"https://github.com/pyinstaller/pyinstaller/milestones/PyInstaller%203.0","labels_url":"https://api.github.com/repos/pyinstaller/pyinstaller/milestones/9/labels","id":831132,"number":9,"title":"PyInstaller 3.0","description":" * '''Add Python 3 support'''\r\n * '''Use modulegraph library for dependency analysis.'''\r\n * !PySide support (should be very similar to !PyQt)\r\n * Update manual and explain better how !PyInstaller works internally.","creator":{"login":"pyinstaller-tickets-migration","id":5377465,"avatar_url":"https://avatars.githubusercontent.com/u/5377465?v=3","gravatar_id":"","url":"https://api.github.com/users/pyinstaller-tickets-migration","html_url":"https://github.com/pyinstaller-tickets-migration","followers_url":"https://api.github.com/users/pyinstaller-tickets-migration/followers","following_url":"https://api.github.com/users/pyinstaller-tickets-migration/following{/other_user}","gists_url":"https://api.github.com/users/pyinstaller-tickets-migration/gists{/gist_id}","starred_url":"https://api.github.com/users/pyinstaller-tickets-migration/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyinstaller-tickets-migration/subscriptions","organizations_url":"https://api.github.com/users/pyinstaller-tickets-migration/orgs","repos_url":"https://api.github.com/users/pyinstaller-tickets-migration/repos","events_url":"https://api.github.com/users/pyinstaller-tickets-migration/events{/privacy}","received_events_url":"https://api.github.com/users/pyinstaller-tickets-migration/received_events","type":"User","site_admin":false},"open_issues":46,"closed_issues":29,"state":"open","created_at":"2014-10-18T13:32:07Z","updated_at":"2015-01-19T09:00:49Z","due_on":null,"closed_at":null},"comments":13,"created_at":"2014-10-18T14:26:55Z","updated_at":"2015-02-25T18:59:43Z","closed_at":"2014-10-18T14:27:12Z","body":"**Original date**: 2013/08/18\n\nmy app depends on ZODB, and uses ZEO, that in turns depends on zope.event and zope.interface, which are two different eggs but use the same namespace.\n```\nsite-packages /\n    zope.event.xxxx.egg/\n       zope/\n          __init__.py\n          event/\n            __init__.py\n    zope.interface.xxxx.egg/\n       zope/\n          __init__.py\n          interface/\n            __init__.py\n```\n\nthe zope.event.xxx.egg/zope/__init__.py file contains :\n\n`__import__('pkg_resources').declare_namespace(__name__)`\n\nand zope.interface.xxx.egg/zope/__init__.py contains:\n```\n# this is a namespace package\ntry:\n    import pkg_resources\n    pkg_resources.declare_namespace(__name__)\nexcept ImportError:\n    import pkgutil\n    __path__ = pkgutil.extend_path(__path__, __name__)\n```\n\ni tried to write a hook, but it can't pick \"hook-zope.event.py\" \ni tried using hiddenimports and even tried to set the pathex \nobviously the app works correctly when using from source. but when i try to package it (with pyinstaller) it says it can't find zope.event. \n\"matysek_\" from irc recommended me to try modulegraph and file a report.\nhere's what i've done :\n```\n>>> from modulegraph.find_modules import find_modules as fm\n>>> mg = fm(['banta/__init__.py'])\n>>> f = open('o.txt', 'w')\n>>> for i in mg.flatten(): f.write(str(i))\n...\n>>> f.close()\n```\nand it finds it"},"comment":{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/comments/76030861","html_url":"https://github.com/pyinstaller/pyinstaller/issues/615#issuecomment-76030861","issue_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/615","id":76030861,"user":{"login":"ypereto","id":11198572,"avatar_url":"https://avatars.githubusercontent.com/u/11198572?v=3","gravatar_id":"","url":"https://api.github.com/users/ypereto","html_url":"https://github.com/ypereto","followers_url":"https://api.github.com/users/ypereto/followers","following_url":"https://api.github.com/users/ypereto/following{/other_user}","gists_url":"https://api.github.com/users/ypereto/gists{/gist_id}","starred_url":"https://api.github.com/users/ypereto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ypereto/subscriptions","organizations_url":"https://api.github.com/users/ypereto/orgs","repos_url":"https://api.github.com/users/ypereto/repos","events_url":"https://api.github.com/users/ypereto/events{/privacy}","received_events_url":"https://api.github.com/users/ypereto/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T18:59:43Z","updated_at":"2015-02-25T18:59:43Z","body":"Another workaround for the zope.interface import problem is to use the following hook-zope.py file.\r\nThis is from http://svn.simo-project.org/simo/trunk/dev/pyinstaller/hooks/hook-zope.py.\r\n\r\n```python\r\nimport os\r\n\r\ndef hook(mod):\r\n    pth = str(mod.__path__[0])\r\n    if os.path.isdir(pth):\r\n        owd = os.getcwd()\r\n        print 'started from', owd\r\n        print 'manipulating', pth\r\n        os.chdir(pth)\r\n        os.chdir('../..')\r\n        cwd = os.getcwd()\r\n        print 'moved to', cwd\r\n        zopedirs = [''.join((cwd, os.sep, item, os.sep, 'zope')) \\\r\n                    for item in os.listdir('.') \\\r\n                    if 'zope' in item and item != 'zope' \\\r\n                       and os.path.isdir(item)]\r\n        if os.path.exists('zope'):\r\n            zopedirs.append(os.path.join(cwd, 'zope'))\r\n        mod.__path__ = zopedirs\r\n        print 'zope.__path__ fixed to:'\r\n        for path in mod.__path__:\r\n            print path\r\n        print 'returning to', owd\r\n        os.chdir(owd)\r\n    return mod\r\n```"}}