<bdo id='SzEaI'></bdo><ul id='SzEaI'></ul>
    <tfoot id='SzEaI'></tfoot>

      1. <legend id='SzEaI'><style id='SzEaI'><dir id='SzEaI'><q id='SzEaI'></q></dir></style></legend>

        <small id='SzEaI'></small><noframes id='SzEaI'>

        <i id='SzEaI'><tr id='SzEaI'><dt id='SzEaI'><q id='SzEaI'><span id='SzEaI'><b id='SzEaI'><form id='SzEaI'><ins id='SzEaI'></ins><ul id='SzEaI'></ul><sub id='SzEaI'></sub></form><legend id='SzEaI'></legend><bdo id='SzEaI'><pre id='SzEaI'><center id='SzEaI'></center></pre></bdo></b><th id='SzEaI'></th></span></q></dt></tr></i><div id='SzEaI'><tfoot id='SzEaI'></tfoot><dl id='SzEaI'><fieldset id='SzEaI'></fieldset></dl></div>
      2. pyinstaller 因情节失败而失败

        时间:2023-09-28

            <small id='jzRZr'></small><noframes id='jzRZr'>

          1. <legend id='jzRZr'><style id='jzRZr'><dir id='jzRZr'><q id='jzRZr'></q></dir></style></legend>

            <tfoot id='jzRZr'></tfoot>
              <bdo id='jzRZr'></bdo><ul id='jzRZr'></ul>
                  <tbody id='jzRZr'></tbody>

                1. <i id='jzRZr'><tr id='jzRZr'><dt id='jzRZr'><q id='jzRZr'><span id='jzRZr'><b id='jzRZr'><form id='jzRZr'><ins id='jzRZr'></ins><ul id='jzRZr'></ul><sub id='jzRZr'></sub></form><legend id='jzRZr'></legend><bdo id='jzRZr'><pre id='jzRZr'><center id='jzRZr'></center></pre></bdo></b><th id='jzRZr'></th></span></q></dt></tr></i><div id='jzRZr'><tfoot id='jzRZr'></tfoot><dl id='jzRZr'><fieldset id='jzRZr'></fieldset></dl></div>

                  本文介绍了pyinstaller 因情节失败而失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 pyinstaller 编译我当前的程序,它似乎无法处理所有必需的文件.它自己运行良好,无需情节它也可以编译和运行.

                  I am compiling my current program using pyinstaller and it seems to not be able to handle all required files in plotly. It runs fine on its own, and without plotly it can compile and run as well.

                  似乎无法找到我什至无法在驱动器上的任何位置找到的文件default-schema.json".

                  It seems be to failing to find a file "default-schema.json" that I cannot even locate anywhere on my drive.

                  Traceback(最近一次调用最后一次):文件comdty_runtime.py",行17,在文件"中,第 2237 行,在_find_and_load 文件",第 2226 行,在 _find_and_load_unlocked 文件"中,第 1191 行,在 _load_unlocked 文件"中,行1161,在 _load_backward_compatible 文件中"d:usersktehraniappdatalocalcontinuumanaconda3envspy34libsite-packagesPyInstallerloaderpyimod03_importers.py",第 389 行,在加载模块exec(bytecode, module.dict) 文件actual_vs_mai.py",第 12 行,在文件",第 2237 行,在_find_and_load 文件",第 2226 行,在 _find_and_load_unlocked 文件"中,第 1191 行,在 _load_unlocked 文件"中,行1161,在 _load_backward_compatible 文件中"d:usersktehraniappdatalocalcontinuumanaconda3envspy34libsite-packagesPyInstallerloaderpyimod03_importers.py",第 389 行,在加载模块exec(bytecode, module.dict) File "site-packagesplotly__init__.py",第 31 行,在 File"",第 2237 行,在 _find_and_load 文件中"",第 2226 行,在 _find_and_load_unlocked文件",第 1191 行,在 _load_unlocked
                  文件",第 1161 行,在_load_backward_compatible 文件d:users*appdatalocalcontinuumanaconda3envspy34libsite-packagesPyInstallerloaderpyimod03_importers.py",第 389 行,在加载模块exec(bytecode, module.dict) 文件site-packagesplotlygraph_objs__init__.py",第 14 行,在
                  文件",第 2237 行,在 _find_and_load
                  文件",第 2226 行,在_find_and_load_unlocked 文件",第 1191 行,在 _load_unlocked 文件",行1161,在 _load_backward_compatible 文件中"d:users*appdatalocalcontinuumanaconda3envspy34libsite-packagesPyInstallerloaderpyimod03_importers.py",第 389 行,在加载模块exec(bytecode, module.dict) 文件site-packagesplotlygraph_objsgraph_objs.py",第 34 行,在文件",第 2237 行,在 _find_and_load
                  文件",第 2226 行,在_find_and_load_unlocked 文件",第 1191 行,在 _load_unlocked 文件",行1161,在 _load_backward_compatible 文件中"d:users*appdatalocalcontinuumanaconda3envspy34libsite-packagesPyInstallerloaderpyimod03_importers.py",第 389 行,在加载模块exec(bytecode, module.dict) 文件site-packagesplotlygraph_reference.py",第 578 行,在
                  文件site-packagesplotlygraph_reference.py",第 70 行,在get_graph_reference 文件站点包setuptools-27.2.0-py3.4.eggpkg_resources__init__.py",第 1215 行,在 resource_string 文件中站点包setuptools-27.2.0-py3.4.eggpkg_resources__init__.py",第 1457 行,在 get_resource_string 文件中站点包setuptools-27.2.0-py3.4.eggpkg_resources__init__.py",第 1530 行,在 _get 文件中"d:users*appdatalocalcontinuumanaconda3envspy34libsite-packagesPyInstallerloaderpyimod03_importers.py",第 474 行,在获取数据使用 open(path, 'rb') as fp: FileNotFoundError: [Errno 2] No such file or directory: 'H:PythonCommodity_MAI_Trade_ListCodedistcomdty_runtimeplotlypackage_datadefault-schema.json' comdty_runtime 执行脚本失败

                  Traceback (most recent call last): File "comdty_runtime.py", line 17, in File "", line 2237, in _find_and_load File "", line 2226, in _find_and_load_unlocked File "", line 1191, in _load_unlocked File "", line 1161, in _load_backward_compatible File "d:usersktehraniappdatalocalcontinuumanaconda3envspy34libsite-p ackagesPyInstallerloaderpyimod03_importers.py", line 389, in load_module exec(bytecode, module.dict) File "actual_vs_mai.py", line 12, in File "", line 2237, in _find_and_load File "", line 2226, in _find_and_load_unlocked File "", line 1191, in _load_unlocked File "", line 1161, in _load_backward_compatible File "d:usersktehraniappdatalocalcontinuumanaconda3envspy34libsite-p ackagesPyInstallerloaderpyimod03_importers.py", line 389, in load_module exec(bytecode, module.dict) File "site-packagesplotly__init__.py", line 31, in File "", line 2237, in _find_and_load File "", line 2226, in _find_and_load_unlocked File "", line 1191, in _load_unlocked
                  File "", line 1161, in _load_backward_compatible File "d:users*appdatalocalcontinuumanaconda3envspy34libsite-p ackagesPyInstallerloaderpyimod03_importers.py", line 389, in load_module exec(bytecode, module.dict) File "site-packagesplotlygraph_objs__init__.py", line 14, in
                  File "", line 2237, in _find_and_load
                  File "", line 2226, in _find_and_load_unlocked File "", line 1191, in _load_unlocked File "", line 1161, in _load_backward_compatible File "d:users*appdatalocalcontinuumanaconda3envspy34libsite-p ackagesPyInstallerloaderpyimod03_importers.py", line 389, in load_module exec(bytecode, module.dict) File "site-packagesplotlygraph_objsgraph_objs.py", line 34, in File "", line 2237, in _find_and_load
                  File "", line 2226, in _find_and_load_unlocked File "", line 1191, in _load_unlocked File "", line 1161, in _load_backward_compatible File "d:users*appdatalocalcontinuumanaconda3envspy34libsite-p ackagesPyInstallerloaderpyimod03_importers.py", line 389, in load_module exec(bytecode, module.dict) File "site-packagesplotlygraph_reference.py", line 578, in
                  File "site-packagesplotlygraph_reference.py", line 70, in get_graph_referenc e File "site-packagessetuptools-27.2.0-py3.4.eggpkg_resources__init__.py", li ne 1215, in resource_string File "site-packagessetuptools-27.2.0-py3.4.eggpkg_resources__init__.py", li ne 1457, in get_resource_string File "site-packagessetuptools-27.2.0-py3.4.eggpkg_resources__init__.py", li ne 1530, in _get File "d:users*appdatalocalcontinuumanaconda3envspy34libsite-p ackagesPyInstallerloaderpyimod03_importers.py", line 474, in get_data with open(path, 'rb') as fp: FileNotFoundError: [Errno 2] No such file or directory: 'H:PythonCommodity_M AI_Trade_ListCodedistcomdty_runtimeplotlypackage_datadefault-schema. json' Failed to execute script comdty_runtime

                  推荐答案

                  我遇到了同样的问题,并通过 pyinstaller 文档找到了解决办法:

                  I came across the same problem, and worked my way through the pyinstaller documentation to find out what to do:

                  pyinstaller 会创建一个与您的 .py 文件同名的 .spec 文件.在a = Analysis下,你会发现datas = []

                  pyinstaller creates a .spec file with the same name as your .py file. under a = Analysis, you will find datas = []

                  a = Analysis(['graphic_interface.py'],
                               pathex=[xxx],
                               binaries=[],
                               datas=[],
                               hiddenimports=[],
                               hookspath=[],
                               runtime_hooks=[],
                               excludes=[],
                               win_no_prefer_redirects=False,
                               win_private_assemblies=False,
                               cipher=block_cipher,
                               noarchive=False)
                  

                  在那里你添加了 plotly 的路径.相对路径对我不起作用,所以我设置了一个绝对路径

                  there you add the path for plotly. a relative path didn't work for me, so I set an absolute path

                  datas=[('C:\Users\Me\PycharmProjects\Project\venv\Lib\site-packages\plotly\', 'plotly')],
                  

                  现在你必须在运行 pyinstaller 时使用 spec 文件

                  now you have to use the spec file when running pyinstaller

                  pyinstaller myproject.spec myproject.py
                  

                  您无需担心其他命令,例如 oneFile 等,因为它们已经保存在 .spec 文件中

                  you dont need to worry about other commands like oneFile etc, because they are already saved in the .spec file

                  这篇关于pyinstaller 因情节失败而失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:用于情节的袖扣:设置袖扣配置选项启动 下一篇:在 plotly 弹出窗口中放置图表

                  相关文章

                2. <legend id='Co5bb'><style id='Co5bb'><dir id='Co5bb'><q id='Co5bb'></q></dir></style></legend>
                  • <bdo id='Co5bb'></bdo><ul id='Co5bb'></ul>
                3. <tfoot id='Co5bb'></tfoot>

                      <i id='Co5bb'><tr id='Co5bb'><dt id='Co5bb'><q id='Co5bb'><span id='Co5bb'><b id='Co5bb'><form id='Co5bb'><ins id='Co5bb'></ins><ul id='Co5bb'></ul><sub id='Co5bb'></sub></form><legend id='Co5bb'></legend><bdo id='Co5bb'><pre id='Co5bb'><center id='Co5bb'></center></pre></bdo></b><th id='Co5bb'></th></span></q></dt></tr></i><div id='Co5bb'><tfoot id='Co5bb'></tfoot><dl id='Co5bb'><fieldset id='Co5bb'></fieldset></dl></div>

                    1. <small id='Co5bb'></small><noframes id='Co5bb'>