{"action":"created","issue":{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1584","labels_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1584/labels{/name}","comments_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1584/comments","events_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1584/events","html_url":"https://github.com/pyinstaller/pyinstaller/issues/1584","id":110179834,"number":1584,"title":"excludedimports in hooks - modules not bundled at all (e.g. FixTk)","user":{"login":"georgemunteanu","id":15011455,"avatar_url":"https://avatars.githubusercontent.com/u/15011455?v=3","gravatar_id":"","url":"https://api.github.com/users/georgemunteanu","html_url":"https://github.com/georgemunteanu","followers_url":"https://api.github.com/users/georgemunteanu/followers","following_url":"https://api.github.com/users/georgemunteanu/following{/other_user}","gists_url":"https://api.github.com/users/georgemunteanu/gists{/gist_id}","starred_url":"https://api.github.com/users/georgemunteanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgemunteanu/subscriptions","organizations_url":"https://api.github.com/users/georgemunteanu/orgs","repos_url":"https://api.github.com/users/georgemunteanu/repos","events_url":"https://api.github.com/users/georgemunteanu/events{/privacy}","received_events_url":"https://api.github.com/users/georgemunteanu/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/hooks","name":"hooks","color":"fef2c0"},{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/labels/v3.0","name":"v3.0","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"htgoebel","id":784161,"avatar_url":"https://avatars.githubusercontent.com/u/784161?v=3","gravatar_id":"","url":"https://api.github.com/users/htgoebel","html_url":"https://github.com/htgoebel","followers_url":"https://api.github.com/users/htgoebel/followers","following_url":"https://api.github.com/users/htgoebel/following{/other_user}","gists_url":"https://api.github.com/users/htgoebel/gists{/gist_id}","starred_url":"https://api.github.com/users/htgoebel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htgoebel/subscriptions","organizations_url":"https://api.github.com/users/htgoebel/orgs","repos_url":"https://api.github.com/users/htgoebel/repos","events_url":"https://api.github.com/users/htgoebel/events{/privacy}","received_events_url":"https://api.github.com/users/htgoebel/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/milestones/11","html_url":"https://github.com/pyinstaller/pyinstaller/milestones/PyInstaller%203.1","labels_url":"https://api.github.com/repos/pyinstaller/pyinstaller/milestones/11/labels","id":1290827,"number":11,"title":"PyInstaller 3.1","description":"* close all feature- and enhancement-requests known at the time 3.0 was released\r\n* clean up the code base (which seams to be necessary after integrating modulegraph)\r\n* update manual and explain better how !PyInstaller works internally.","creator":{"login":"htgoebel","id":784161,"avatar_url":"https://avatars.githubusercontent.com/u/784161?v=3","gravatar_id":"","url":"https://api.github.com/users/htgoebel","html_url":"https://github.com/htgoebel","followers_url":"https://api.github.com/users/htgoebel/followers","following_url":"https://api.github.com/users/htgoebel/following{/other_user}","gists_url":"https://api.github.com/users/htgoebel/gists{/gist_id}","starred_url":"https://api.github.com/users/htgoebel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htgoebel/subscriptions","organizations_url":"https://api.github.com/users/htgoebel/orgs","repos_url":"https://api.github.com/users/htgoebel/repos","events_url":"https://api.github.com/users/htgoebel/events{/privacy}","received_events_url":"https://api.github.com/users/htgoebel/received_events","type":"User","site_admin":false},"open_issues":109,"closed_issues":27,"state":"open","created_at":"2015-09-04T16:32:45Z","updated_at":"2015-10-17T20:46:47Z","due_on":"2015-12-30T23:00:00Z","closed_at":null},"comments":16,"created_at":"2015-10-07T08:57:46Z","updated_at":"2015-10-18T12:54:54Z","closed_at":null,"body":"[INPUT]\r\n```python\r\nimport Tkinter\r\nimport os\r\nfrom Tkinter import *\r\n\r\n# Create Tk instance\r\nroot = Tkinter.Tk(className=\"test\")\r\n\r\n# Open Notepad\r\ndef openNotepad():   \r\n    import pywinauto\r\n    app = pywinauto.Application.start(\"notepad.exe\")\r\n   \r\n\r\n# Add menu \r\nmenu = Menu(root)\r\nroot.config(menu=menu)\r\nfilemenu = Menu(menu)\r\nmenu.add_cascade(label=\"01 File\", menu=filemenu)\r\nfilemenu.add_command(label=\"New\", command=openNotepad)\r\n\r\n# Pack all\r\nroot.mainloop()\r\n```\r\n\r\n[OUTPUT]\r\n```\r\nwhen running exe file I will see:\r\nTraceback (most recent call last):\r\n  File \"<string>\", line 17, in <module>\r\n  File \"C:\\Python27\\Lib\\site-packages\\PyInstaller\\loader\\pyimod03_importers.py\", line 363, in load_m\r\nodule\r\n    exec(bytecode, module.__dict__)\r\n  File \"C:\\Python27\\lib\\lib-tk\\Tkinter.py\", line 38, in <module>\r\n    import FixTk\r\nImportError: No module named FixTk\r\ntest returned -1\r\n```\r\n\r\nNOTE: I am using: python 2.7.10. I am using pyinstaller: 3.0\r\nNOTE: When running the .py everything works as expected.\r\nNOTE: If I remove the openNotepad function than the exe file will not return any error, therefore the app. created with Tkinter works.\r\nNOTE: If I remove the the Tkinter part (thus leaving only the openNotepad) then the exe file open the Notepad.\r\nNOTE: According to docs: https://github.com/pyinstaller/pyinstaller/wiki/Supported-Packages, the pywinauto library is supported\r\n\r\nThat's why please share what I am missing out.\r\nTake care\r\n\r\nIt is caused by complex implementation of `excludedimports` attribute in hooks. There is proposed a better and simpler implementation for `excludedimports`: https://github.com/pyinstaller/pyinstaller/issues/1553#issuecomment-144934669\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/comments/149008776","html_url":"https://github.com/pyinstaller/pyinstaller/issues/1584#issuecomment-149008776","issue_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1584","id":149008776,"user":{"login":"htgoebel","id":784161,"avatar_url":"https://avatars.githubusercontent.com/u/784161?v=3","gravatar_id":"","url":"https://api.github.com/users/htgoebel","html_url":"https://github.com/htgoebel","followers_url":"https://api.github.com/users/htgoebel/followers","following_url":"https://api.github.com/users/htgoebel/following{/other_user}","gists_url":"https://api.github.com/users/htgoebel/gists{/gist_id}","starred_url":"https://api.github.com/users/htgoebel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htgoebel/subscriptions","organizations_url":"https://api.github.com/users/htgoebel/orgs","repos_url":"https://api.github.com/users/htgoebel/repos","events_url":"https://api.github.com/users/htgoebel/events{/privacy}","received_events_url":"https://api.github.com/users/htgoebel/received_events","type":"User","site_admin":false},"created_at":"2015-10-18T12:54:54Z","updated_at":"2015-10-18T12:54:54Z","body":"Buh, I had to change the implementation if TOC and Tree first to get the `.toc`-files really pretty printed. This took quite some time.\r\n\r\n@matysek My approach would be this: In a hook, \"excludedimports\" would *not* remove all references to that module, but just the edge from this hook's module to the \"excluded\" import.\r\n\r\nWhen looking at `_ImportHook.process_excludedimports`, I have the impression this does too much. It is not only removing the connection between the modules, but also completly removes the node (at least in some cases). I'll try to rework this. Stay tuned."}}