{"action":"created","issue":{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1663","labels_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1663/labels{/name}","comments_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1663/comments","events_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1663/events","html_url":"https://github.com/pyinstaller/pyinstaller/issues/1663","id":115721256,"number":1663,"title":"PyCrypto - ImportError with Crypto.Cipher._AES when using --key option","user":{"login":"benmao","id":173095,"avatar_url":"https://avatars.githubusercontent.com/u/173095?v=3","gravatar_id":"","url":"https://api.github.com/users/benmao","html_url":"https://github.com/benmao","followers_url":"https://api.github.com/users/benmao/followers","following_url":"https://api.github.com/users/benmao/following{/other_user}","gists_url":"https://api.github.com/users/benmao/gists{/gist_id}","starred_url":"https://api.github.com/users/benmao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benmao/subscriptions","organizations_url":"https://api.github.com/users/benmao/orgs","repos_url":"https://api.github.com/users/benmao/repos","events_url":"https://api.github.com/users/benmao/events{/privacy}","received_events_url":"https://api.github.com/users/benmao/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/labels/@medium","name":"@medium","color":"FFD07D"}],"state":"open","locked":false,"assignee":{"login":"matysek","id":527280,"avatar_url":"https://avatars.githubusercontent.com/u/527280?v=3","gravatar_id":"","url":"https://api.github.com/users/matysek","html_url":"https://github.com/matysek","followers_url":"https://api.github.com/users/matysek/followers","following_url":"https://api.github.com/users/matysek/following{/other_user}","gists_url":"https://api.github.com/users/matysek/gists{/gist_id}","starred_url":"https://api.github.com/users/matysek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matysek/subscriptions","organizations_url":"https://api.github.com/users/matysek/orgs","repos_url":"https://api.github.com/users/matysek/repos","events_url":"https://api.github.com/users/matysek/events{/privacy}","received_events_url":"https://api.github.com/users/matysek/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":98,"closed_issues":76,"state":"open","created_at":"2015-09-04T16:32:45Z","updated_at":"2015-11-26T22:09:13Z","due_on":"2015-12-30T23:00:00Z","closed_at":null},"comments":8,"created_at":"2015-11-08T09:59:58Z","updated_at":"2015-11-27T10:27:37Z","closed_at":null,"body":"## test4.py\r\n\r\n```\r\n#!/usr/bin/env python\r\n# coding:utf-8\r\n\r\nimport Crypto.Cipher.AES\r\n\r\nif __name__ == '__main__':\r\n    print \"run success\"\r\n```\r\n\r\n## build command\r\n\r\n>pyinstaller.py  test4.py --debug --key=123\r\n\r\n## output\r\n\r\n```\r\nPyInstaller Bootloader 3.x\r\nLOADER: executable is e:\\poppy\\gg\\dist\\test4\\test4.exe\r\nLOADER: homepath is e:\\poppy\\gg\\dist\\test4\r\nLOADER: _MEIPASS2 is NULL\r\nLOADER: archivename is e:\\poppy\\gg\\dist\\test4\\test4.exe\r\nLOADER: No need to extract files to run; setting extractionpath to homepath\r\nLOADER: SetDllDirectory(e:\\poppy\\gg\\dist\\test4)\r\nLOADER: Already in the child - running user's code.\r\nLOADER: Python library: e:\\poppy\\gg\\dist\\test4\\python27.dll\r\nLOADER: Loaded functions from Python library.\r\nLOADER: Manipulating environment (sys.path, sys.prefix)\r\nLOADER: sys.prefix is e:\\poppy\\gg\\dist\\test4\r\nLOADER: Setting runtime options\r\nLOADER: Initializing python\r\nLOADER: Overriding Python's sys.path\r\nLOADER: Post-init sys.path is e:\\poppy\\gg\\dist\\test4\r\nLOADER: Setting sys.argv\r\nLOADER: setting sys._MEIPASS\r\nLOADER: importing modules from CArchive\r\nLOADER: extracted pyimod00_crypto_key\r\nLOADER: callfunction returned...\r\nLOADER: extracted struct\r\nLOADER: callfunction returned...\r\nLOADER: extracted pyimod01_os_path\r\nLOADER: callfunction returned...\r\nLOADER: extracted pyimod02_archive\r\nLOADER: callfunction returned...\r\nLOADER: extracted pyimod03_importers\r\nLOADER: callfunction returned...\r\nLOADER: Installing PYZ archive with Python modules.\r\nLOADER: PYZ archive: out00-PYZ.pyz\r\nLOADER: Running pyiboot01_bootstrap.py\r\nLOADER: Running test4.py\r\nTraceback (most recent call last):\r\n  File \"<string>\", line 4, in <module>\r\n  File \"d:\\pyinstaller2\\PyInstaller\\loader\\pyimod03_importers.py\", line 364, in load_module\r\n    exec(bytecode, module.__dict__)\r\n  File \"D:\\Python27\\lib\\site-packages\\Crypto\\Cipher\\AES.py\", line 50, in <module>\r\n    from Crypto.Cipher import _AES\r\nImportError: cannot import name _AES\r\ntest4 returned -1\r\nLOADER: OK.\r\nLOADER: Cleaning up Python interpreter.\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/comments/160107369","html_url":"https://github.com/pyinstaller/pyinstaller/issues/1663#issuecomment-160107369","issue_url":"https://api.github.com/repos/pyinstaller/pyinstaller/issues/1663","id":160107369,"user":{"login":"matysek","id":527280,"avatar_url":"https://avatars.githubusercontent.com/u/527280?v=3","gravatar_id":"","url":"https://api.github.com/users/matysek","html_url":"https://github.com/matysek","followers_url":"https://api.github.com/users/matysek/followers","following_url":"https://api.github.com/users/matysek/following{/other_user}","gists_url":"https://api.github.com/users/matysek/gists{/gist_id}","starred_url":"https://api.github.com/users/matysek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matysek/subscriptions","organizations_url":"https://api.github.com/users/matysek/orgs","repos_url":"https://api.github.com/users/matysek/repos","events_url":"https://api.github.com/users/matysek/events{/privacy}","received_events_url":"https://api.github.com/users/matysek/received_events","type":"User","site_admin":false},"created_at":"2015-11-27T10:27:37Z","updated_at":"2015-11-27T10:27:37Z","body":"* I was able to reproduce it on Linux with the code from the description.\r\n* PyInstaller's `crypto feature` uses module `Crypto.Cipher._AES` and somehow it interferes with PyCrypto when using that module in your code."}}