{"action":"created","issue":{"url":"https://api.github.com/repos/pyqt/python-qt5/issues/2","labels_url":"https://api.github.com/repos/pyqt/python-qt5/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/pyqt/python-qt5/issues/2/comments","events_url":"https://api.github.com/repos/pyqt/python-qt5/issues/2/events","html_url":"https://github.com/pyqt/python-qt5/issues/2","id":43105452,"number":2,"title":"Qt platform plugin \"windows\"","user":{"login":"mottosso","id":2152766,"avatar_url":"https://avatars.githubusercontent.com/u/2152766?v=3","gravatar_id":"","url":"https://api.github.com/users/mottosso","html_url":"https://github.com/mottosso","followers_url":"https://api.github.com/users/mottosso/followers","following_url":"https://api.github.com/users/mottosso/following{/other_user}","gists_url":"https://api.github.com/users/mottosso/gists{/gist_id}","starred_url":"https://api.github.com/users/mottosso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mottosso/subscriptions","organizations_url":"https://api.github.com/users/mottosso/orgs","repos_url":"https://api.github.com/users/mottosso/repos","events_url":"https://api.github.com/users/mottosso/events{/privacy}","received_events_url":"https://api.github.com/users/mottosso/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pyqt/python-qt5/labels/5.3.2","name":"5.3.2","color":"006b75"},{"url":"https://api.github.com/repos/pyqt/python-qt5/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-09-18T07:57:08Z","updated_at":"2015-02-05T15:38:56Z","closed_at":null,"body":"Cannot instantiate a QApplication.\r\n\r\n```python\r\nimport sys\r\nfrom PyQt5 import QtWidgets\r\n\r\napp = QtWidgets.QApplication(sys.argv)\r\n```\r\n\r\nResults in:\r\n\r\n```bat\r\nThis application failed to start because it could not find or load the Qt platfo\r\nrm plugin \"windows\".\r\n\r\nAvailable platform plugins are: minimal (from C:\\Python27\\lib\\site-packages\\PyQt\r\n5\\plugins\\platforms), offscreen (from C:\\Python27\\lib\\site-packages\\PyQt5\\plugin\r\ns\\platforms), windows (from C:\\Python27\\lib\\site-packages\\PyQt5\\plugins\\platform\r\ns).\r\n\r\nReinstalling the application may fix this problem.\r\n```\r\n\r\nHaving encountered the problem in the past, I could solve it by appending the plugins by hand like this:\r\n\r\n```python\r\nimport os\r\nimport sys\r\n\r\nimport PyQt5\r\n\r\ndirname = os.path.dirname(PyQt5.__file__)\r\nplugin_path = os.path.join(dirname, 'plugins', 'platforms')\r\nos.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = plugin_path\r\n\r\nfrom PyQt5 import QtWidgets\r\napp = QtWidgets.QApplication(sys.argv)\r\n```\r\n\r\nHowever this produces the same error. The odd thing is that it says it can't load the plugin, and then lists the plugin as one of the available ones. Maybe a permission issue? Yet permissions on the files are unlocked and even replacing it with the source original from the Qt installation yields the same results. Removing the plugin from the directory correctly removes it from plugins found.\r\n\r\n### depends.exe\r\n\r\nRunning depends on qwindows.dll yields a few interesting results.\r\n\r\n![depends](https://cloud.githubusercontent.com/assets/2152766/4316602/e6c69332-3f08-11e4-9ab5-9f4c38e611cb.PNG)\r\n\r\nHowever each of these are available directly within the PyQt5 Python package directory.\r\n\r\n### It works\r\n\r\nIf keeping the original installation of Qt on the PATH, PyQt5 seems to work. From a terminal:\r\n\r\n```python\r\n# Keeping C:\\Qt\\Qt5.3.0\\5.3\\msvc2013_64\\bin on the PATH\r\n\r\nimport os\r\nimport sys\r\n\r\nfrom PyQt5 import QtWidgets\r\napp = QtWidgets.QApplication(sys.argv)\r\nbutton = QtWidgets.QPushButton(\"Hello World\")\r\nbutton.show()\r\n```\r\n\r\nSo there must be something within this directory which is requited by PyQt5. But copying the entire contents into the PyQt5 Python library directory yields no better results."},"comment":{"url":"https://api.github.com/repos/pyqt/python-qt5/issues/comments/73066666","html_url":"https://github.com/pyqt/python-qt5/issues/2#issuecomment-73066666","issue_url":"https://api.github.com/repos/pyqt/python-qt5/issues/2","id":73066666,"user":{"login":"mottosso","id":2152766,"avatar_url":"https://avatars.githubusercontent.com/u/2152766?v=3","gravatar_id":"","url":"https://api.github.com/users/mottosso","html_url":"https://github.com/mottosso","followers_url":"https://api.github.com/users/mottosso/followers","following_url":"https://api.github.com/users/mottosso/following{/other_user}","gists_url":"https://api.github.com/users/mottosso/gists{/gist_id}","starred_url":"https://api.github.com/users/mottosso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mottosso/subscriptions","organizations_url":"https://api.github.com/users/mottosso/orgs","repos_url":"https://api.github.com/users/mottosso/repos","events_url":"https://api.github.com/users/mottosso/events{/privacy}","received_events_url":"https://api.github.com/users/mottosso/received_events","type":"User","site_admin":false},"created_at":"2015-02-05T15:38:56Z","updated_at":"2015-02-05T15:38:56Z","body":"This problem re-surfaces in certain situations that I am unable to re-produce.\r\n\r\n![image](https://cloud.githubusercontent.com/assets/2152766/6063145/feebff08-ad4c-11e4-96ee-dfe845d6725a.png)\r\n\r\nThe above was reported by @davidmartinezanim on a Windows 7 machine, running Python 2.7.9 x64 with Visual C++ 2013 re-distributable installed."}}