{"id":667,"date":"2020-04-01T01:35:10","date_gmt":"2020-03-31T17:35:10","guid":{"rendered":"http:\/\/www.mustenaka.cn\/?p=667"},"modified":"2020-04-01T01:35:56","modified_gmt":"2020-03-31T17:35:56","slug":"failed-to-execute-script-pyi_rth_pkgres","status":"publish","type":"post","link":"https:\/\/www.mustenaka.cn\/index.php\/2020\/04\/01\/failed-to-execute-script-pyi_rth_pkgres\/","title":{"rendered":"Pyinstaller\u6253\u5305\u62a5\u9519Failed to execute script pyi_rth_pkgres"},"content":{"rendered":"<h3>Pyinstaller\u6253\u5305\u62a5\u9519Failed to execute script pyi_rth_pkgres<\/h3>\n<p>Pyinstaller\u6253\u5305\u9879\u76ee\u6587\u4ef6\u7684\u65f6\u5019<\/p>\n<h3>\u51fa\u73b0\u62a5\u9519<\/h3>\n<blockquote><p>fatal error detected<\/p>\n<p>failed to execute script pyi_rth_pkgres<\/p><\/blockquote>\n<p><!--more--><\/p>\n<blockquote><p>\u68c0\u6d4b\u5230\u81f4\u547d\u9519\u8bef<\/p>\n<p>\u65e0\u6cd5\u6267\u884c\u811a\u672cpyi_rth_pkgres<\/p><\/blockquote>\n<p><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/www.mustenaka.cn\/wp-content\/uploads\/2020\/04\/CNBR2CGU5LTAWD.png\" alt=\"\" width=\"309\" height=\"169\" class=\"alignnone size-full wp-image-668\" srcset=\"https:\/\/www.mustenaka.cn\/wp-content\/uploads\/2020\/04\/CNBR2CGU5LTAWD.png 309w, https:\/\/www.mustenaka.cn\/wp-content\/uploads\/2020\/04\/CNBR2CGU5LTAWD-300x164.png 300w\" sizes=\"(max-width: 309px) 100vw, 309px\" \/><\/p>\n<p>\u601d\u6765\u60f3\u53bb\uff0c\u6211\u5199\u7684\u9879\u76ee\u5e76\u6ca1\u6709\u7528\u5230\u8fd9\u4e2a\u53eb\u505apyi_rth_pkgres\u7684\u811a\u672c\uff0c\u7531\u4e8e\u6211\u662f\u4f7f\u7528conda\u521b\u5efa\u7684\u5b50\u73af\u5883\u4e0b\u8f7d\u7684pyinstaller\uff08\u6211\u624d\u91cd\u88c5\u8fc7\u7cfb\u7edf\uff09\uff0c\u83ab\u975e\u662fanaconda\u4e2dpackage\u51fa\u73b0\u4e86\u95ee\u9898\u5bfc\u81f4\u8fd9\u4e2a\u60c5\u51b5\u3002<\/p>\n<p>\u5148\u662f\u7ecf\u8fc7\u7f51\u4e0a\u5927\u91cf\u7684\u8bf4\u7528\u7684\u65b9\u6cd5\uff08\u5b9e\u9645\u4e0a\u4e00\u70b9\u7528\u90fd\u6ca1\u6709\uff09<\/p>\n<p>\u539f\u7406\u5927\u81f4\u5c31\u662f\u5ffd\u7565\u8fd9\u4e2a\u5305<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\" python=\"\">pyinstaller --hidden-import pyi_rth_pkgres -w -F C:\/kivy_test.py<\/code><\/pre>\n<p>\u5b9e\u9645\u4e0a<strong>\u6beb\u65e0\u4f5c\u7528<\/strong>\uff0c\u4f9d\u65e7\u62a5\u9519\uff08\u53e6\u4e00\u4e2a\u5185\u5bb9\uff09<\/p>\n<p>\u5c1d\u8bd5\u91cd\u88c5pyinstaller<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\" python=\"\">pip uninstall pyinstaller\r\npip install https:\/\/github.com\/pyinstaller\/pyinstaller\/archive\/develop.zip<\/code><\/pre>\n<p>\u4f9d\u65e7<strong>\u6beb\u65e0\u4f5c\u7528<\/strong>\uff0c\u62a5\u9519\u4fe1\u606f\u4efb\u7136\u4e00\u6837\u3002<\/p>\n<p>\u5f00\u59cb\u6392\u67e5\uff0c\u53d1\u73b0\u66fe\u7ecf\u7684\u6253\u5305\u53c2\u6570\u4f9d\u65e7\u5168\u90e8\u4fdd\u7559\uff0c\u6709\u4e00\u4e9b\u8def\u5f84\u4fe1\u606f\u4efb\u7136\u8fd8\u5728\uff0c\u4e8e\u662f\u6211\u5728\u9879\u76ee\u6587\u4ef6\u5939\u4e2d\u4f9d\u6b21\u5220\u9664\u4e86\uff0cbuild\/\uff0cdist\/\uff0c\u53camain.spec\u8fd9\u4e09\u4e2a\u7528\u4e8e\u5b58\u50a8\u6253\u5305\u914d\u7f6e\u7684\u4fe1\u606f\u6587\u4ef6\u3002<\/p>\n<h4>\u518d\u5ea6\u6253\u5305\uff0c\u6210\u529f<\/h4>\n<p>\u8bf4\u660epyinstaller\u521b\u5efa\u7684\u914d\u7f6e\u76f8\u5173\u7f13\u5b58\u6587\u4ef6\u5e76\u4e0d\u662f\u6bcf\u6b21\u521b\u5efa\u7684\uff0c\u662f\u7b2c\u4e00\u6b21\u521b\u5efa\uff0c\u4e4b\u540e\u76f4\u63a5\u8bfb\u53d6\uff0c\u4e00\u65e6\u53d1\u751f\u4e00\u4e01\u70b9\u7684\u73af\u5883\u53d8\u5316\uff0c\u6253\u5305\u53ef\u80fd\u5c31\u4f1a\u9047\u5230\u95ee\u9898\u3002<\/p>\n<p>PS\uff1a<\/p>\n<p>\u5f53\u65f6\u7f51\u4e0a\u8fd8\u627e\u4e86\u4e00\u4e9b\u8d44\u6599<\/p>\n<ul>\n<li><strong>main return -1<\/strong><\/li>\n<li>\n<blockquote><p>\u8fd9\u79cd\u9519\u8bef\u57fa\u672c\u90fd\u662f\u81ea\u5df1\u7684\u95ee\u9898, \u53ea\u80fd\u5728\u8f93\u51faexe\u65f6\u53c2\u6570\u52a0\u4e2a\u2019-d\u2019\u5373debug\u6a21\u5f0f, \u7136\u540e\u518d\u67e5\u4e0b\u6253\u5370\u7684\u9519\u8bef\u4fe1\u606fFailed to execute script pyi_rth_pkgres<\/p><\/blockquote>\n<\/li>\n<li>\n<blockquote><p>\u53ef\u4ee5\u5148\u6362Pyinstaller\u7684\u7248\u672c, \u8fd9\u4e2a\u9519\u8bef\u4f1a\u6d88\u5931, \u4f46\u4f1a\u5f39\u51fa\u5176\u4ed6\u7684\u9519\u8bef\u4fe1\u606f, \u7136\u5e76\u5375\u8fd9\u79cd\u9519\u8bef\u57fa\u672c\u90fd\u662f\u81ea\u5df1\u7684\u95ee\u9898, \u53ea\u80fd\u5728\u8f93\u51faexe\u65f6\u53c2\u6570\u52a0\u4e2a\u2019-d\u2019\u5373debug\u6a21\u5f0f, \u7136\u540e\u518d\u67e5\u4e0b\u6253\u5370\u7684\u9519\u8bef\u4fe1\u606f<\/p><\/blockquote>\n<p><strong>Failed to execute script xxxx<\/strong><\/li>\n<li>\n<blockquote><p>\u8fd9\u79cd\u9519\u8bef\u57fa\u672c\u90fd\u662f\u81ea\u5df1\u7684\u95ee\u9898, \u53ea\u80fd\u5728\u8f93\u51faexe\u65f6\u53c2\u6570\u52a0\u4e2a\u2019-d\u2019\u5373debug\u6a21\u5f0f, \u7136\u540e\u518d\u67e5\u4e0b\u6253\u5370\u7684\u9519\u8bef\u4fe1\u606f<\/p><\/blockquote>\n<p><strong>This application failed to start \u2026 Qt platform plugin \u2026<\/strong><\/li>\n<li>\n<blockquote><p>\u8fd9\u79cd\u9519\u8bef\u5148\u914d\u4e0bPyQt5\u7684plugins\u7684\u73af\u5883\u53d8\u91cf, \u5982\u535a\u4e3b\u7684\u662fC:\\Python34\\Lib\\site-packages\\PyQt5\\plugins\u4e0d\u884c\u518d\u6362Pyinstaller\u7684\u7248\u672c (\u8c8c\u4f3c3.0.0\u8fd9\u4e2a\u7248\u672c\u6709\u95ee\u9898, \u540e\u6765\u63623.2.1\u5c31\u6ca1\u4e8b\u4e86)<\/p><\/blockquote>\n<\/li>\n<\/ul>\n<h3>\u4e2a\u4eba\u5efa\u8bae<\/h3>\n<p>\u5b9e\u9645\u6d4b\u8bd5\u7684\u65f6\u5019debug\u6a21\u5f0f\u76f8\u5bf9\u6bd4\u8f83\u96be\u4ee5\u770b\u61c2\uff08\u6211\u4e0d\u662f\u4e13\u4e1a\u7684\u6d4b\u8bd5\u5458\uff09\uff0c\u56e0\u6b64\u5173\u4e8edebug\u7684\u5efa\u8bae\uff0c\u6211\u9009\u62e9\u6253\u5305\u7684\u65f6\u5019\u8f93\u5165 pyinstaller -F main.py \u7684\u65b9\u5f0f\uff0c\u663e\u793a\u7ec8\u7aef\uff08\u53c2\u6570-w\u8868\u793a\u9690\u85cf\u7ec8\u7aef\uff09\uff0c\u540c\u65f6\u5728\u8bbe\u8ba1\u7a0b\u5e8f\u7684\u65f6\u5019\u7075\u6d3b\u4f7f\u7528try-catch\u4ee5\u53ca\u53ca\u65f6\u7684print\u4fe1\u606f\u3002<\/p>\n<p>\u7528\u8fd9\u4e2a\u65b9\u5f0f\u6253\u5305\u5b8c\u6210\u4e4b\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528.\/main.exe\u7684\u65b9\u5f0f\u5728cmd\uff08terminal\uff09\u4e0b\u8fd0\u884c\uff0c\u7b2c\u4e00\u624b\u7684\u9519\u8bef\u4fe1\u606f\u5168\u90e8\u5728\u7ec8\u7aef\u4e0a\u53ef\u89c1\uff08\u5e76\u975e\u4f7f\u7528logging\u7b49\u9519\u8bef\u65e5\u5fd7\u7c7b\uff0c\u65e0\u6cd5\u76f4\u63a5\u542f\u52a8\u7684\u7a0b\u5e8f\u770b\u4e0d\u5230\u9519\u8bef\u5bfc\u51fa\uff09\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pyinstaller\u6253\u5305\u9879\u76ee\u6587\u4ef6\u7684\u65f6\u5019\u51fa\u73b0\u62a5\u9519failed to execute script pyi_rth_pkgres\u89e3\u51b3\u65b9\u6848<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30,53],"tags":[67,65,31,40,66],"class_list":["post-667","post","type-post","status-publish","format-standard","hentry","category-python","category-softwareengineering","tag-pyinstaller","tag-pyqt","tag-python","tag-qt","tag-package"],"views":16757,"_links":{"self":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/667","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/comments?post=667"}],"version-history":[{"count":3,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/667\/revisions"}],"predecessor-version":[{"id":671,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/667\/revisions\/671"}],"wp:attachment":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/media?parent=667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/categories?post=667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/tags?post=667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}