久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

        <bdo id='t5bnO'></bdo><ul id='t5bnO'></ul>
        <legend id='t5bnO'><style id='t5bnO'><dir id='t5bnO'><q id='t5bnO'></q></dir></style></legend>
        <tfoot id='t5bnO'></tfoot>
        <i id='t5bnO'><tr id='t5bnO'><dt id='t5bnO'><q id='t5bnO'><span id='t5bnO'><b id='t5bnO'><form id='t5bnO'><ins id='t5bnO'></ins><ul id='t5bnO'></ul><sub id='t5bnO'></sub></form><legend id='t5bnO'></legend><bdo id='t5bnO'><pre id='t5bnO'><center id='t5bnO'></center></pre></bdo></b><th id='t5bnO'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='t5bnO'><tfoot id='t5bnO'></tfoot><dl id='t5bnO'><fieldset id='t5bnO'></fieldset></dl></div>

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

        PyInstalled Kivy 應用程序無法在第二臺機器上運行

        PyInstalled Kivy App Fails to Run on Second Machine(PyInstalled Kivy 應用程序無法在第二臺機器上運行)

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

        <legend id='RqoeN'><style id='RqoeN'><dir id='RqoeN'><q id='RqoeN'></q></dir></style></legend>
      1. <tfoot id='RqoeN'></tfoot>
            <bdo id='RqoeN'></bdo><ul id='RqoeN'></ul>

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

                  <tbody id='RqoeN'></tbody>

                1. 本文介紹了PyInstalled Kivy 應用程序無法在第二臺機器上運行的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在使用 PyInstaller (3.4) 打包一個 Kivy 應用程序,以便在 Windows 機器上使用.我已經讓它在我的機器上編譯和工作,但是當將 exe 移動到另一個時,它無法給出錯誤:

                  I'm packaging a Kivy app using PyInstaller (3.4) for use on Windows machines. I've gotten it to compile and work on my machine but when moving the exe to another, it fails giving the error:

                  [WARNING] [Image       ] Unable to load image 
                  C:Users<OTHER_MACHINES_USER>AppDataLocalTemp_MEI38442kivy_installdataglsldefault.png>
                  [CRITICAL] [Window      ] Unable to find any valuable Window provider.
                  sdl2 - Exception: SDL2: Unable to load image
                  

                  當整個東西被復制時(如在 ./dist/client_iface.exe 中),這在 dist 文件夾中起作用,所以我認為這是一個依賴問題我'一直無法解決,顯然是使用 SDL2.

                  This works from the dist folder when the whole thing is copied across (as in ./dist/client_iface.exe) and so I figure its a dependency issue I've been unable to resolve, apparently with SDL2.

                  我相信這個問題與 幾乎相同這個問題 但是這個問題已經存在兩年了,至今還沒有成功的解決方案.

                  I believe that this problem is almost identical to this problem however that question is two years old and as yet has no successful solution.

                  我遵循了許多指南(包括 這個 從上面的帖子鏈接)但沒有成功.

                  I've followed a number of guides (including this one which is linked from the above post) but with no success.

                  規范文件,根據 Kivy 指南進行了調整, 如下:

                  The spec file, with adjustments as per the Kivy guide, is as follows:

                  # -*- mode: python -*-
                  
                  from kivy.deps import sdl2, glew
                  import os
                  
                  block_cipher = None
                  
                  a = Analysis(
                      ['client_iface.py'],
                      pathex=['D:\Users\<USER>\Documents\2_Projects\py_dice_roller\client'],
                      binaries=[('D:\Users\<USER>\Documents\2_Projects\DnD\py_dice_roller\client\SDL2.dll', '.')],
                      datas=[],
                      hiddenimports=[],
                      hookspath=[],
                      runtime_hooks=[],
                      excludes=[],
                      win_no_prefer_redirects=False,
                      win_private_assemblies=False,
                      cipher=block_cipher,
                      noarchive=False
                  )
                  a.datas += [
                      ('client_iface.kv', '.\client_iface.kv', 'DATA'), 
                      ('active.png', '.\images\active.png', 'DATA'),
                      ('back.png', '.\images\active.png', 'DATA'),
                      ('normal.png', '.\images\active.png', 'DATA'),
                      ('DroidSansMono.ttf', '.\fonts\DroidSansMono.ttf', 'DATA')
                  ]
                  pyz = PYZ(a.pure, a.zipped_data,
                               cipher=block_cipher
                  )
                  exe = EXE(
                      pyz,
                      a.scripts,
                      a.binaries,
                      a.zipfiles,
                      a.datas,
                      [],
                      name='client_iface',
                      debug=False,
                      bootloader_ignore_signals=False,
                      strip=False,
                      upx=True,
                      runtime_tmpdir=None,
                      console=True,
                      icon='.imagesicon_dWU_icon.ico',
                  )
                  coll = COLLECT(
                      exe, Tree(os.getcwd()),
                      a.binaries,
                      a.zipfiles,
                      a.datas,
                      *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
                      strip=False,
                      upx=True,
                      name='client_iface'
                  )
                  

                  按照上面的鏈接,我在腳本中包含了以下代碼:

                  And following the above linked I have included the following code in the script:

                  
                  def resourcePath(path):
                      if hasattr(sys, '_MEIPASS'):
                          return os.path.join(sys._MEIPASS)
                  
                      return os.path.join(os.path.abspath(path))
                  
                  if __name__ == '__main__':
                      kivy.resources.resource_add_path(resourcePath('.'))
                      kivy.resources.resource_add_path(resourcePath('./images'))
                      main_app().run()
                  
                  

                  我使用的命令是:

                  python -m PyInstaller -F --onefile .client_iface.spec
                  

                  預期結果是生成的單個可執行文件可以在任何類似機器上運行而不會出錯或不需要整個文件夾的附加文件.

                  The expected result would be that the single executable produced would run on any like-machine without error-ing or the need for the entire folder of additional files.

                  任何幫助將不勝感激.

                  推薦答案

                  .spec 文件的 COLLECT 部分表示 onedir將創建可執行文件.為了使 onefile 可執行,您需要刪除 COLLECT 部分.此外,COLLECT 部分中列出的 sdl2 和 glew deps 可以作為 *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)] 代替出現在第一個關鍵字參數之前的默認 [],.

                  The COLLECT section of your .spec file indicates that a onedir executable will be created. In order to make a onefile executable, you will need to remove the COLLECT section. Also, the sdl2 and glew deps that are listed in the COLLECT section can be added to the EXE section as *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)] in place of the default [], that appears before the first keyword argument.

                  另外,請注意,如果您使用的是 .spec 文件,則 Pyinstaller 的大多數命令行選項都會被忽略.有關詳細信息,請參閱 文檔.不幸的是,Pyinstaller 文檔在很多地方都相當模糊.

                  Also, note that most of the command line options of Pyinstaller are ignored if you are using a .spec file. Refer to the documentation for more details. Unfortunately, the Pyinstaller documentation is rather vague in many places.

                  這篇關于PyInstalled Kivy 應用程序無法在第二臺機器上運行的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)

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

                2. <i id='ab5ar'><tr id='ab5ar'><dt id='ab5ar'><q id='ab5ar'><span id='ab5ar'><b id='ab5ar'><form id='ab5ar'><ins id='ab5ar'></ins><ul id='ab5ar'></ul><sub id='ab5ar'></sub></form><legend id='ab5ar'></legend><bdo id='ab5ar'><pre id='ab5ar'><center id='ab5ar'></center></pre></bdo></b><th id='ab5ar'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ab5ar'><tfoot id='ab5ar'></tfoot><dl id='ab5ar'><fieldset id='ab5ar'></fieldset></dl></div>
                  <tfoot id='ab5ar'></tfoot>
                  <legend id='ab5ar'><style id='ab5ar'><dir id='ab5ar'><q id='ab5ar'></q></dir></style></legend>
                    <tbody id='ab5ar'></tbody>

                        • <bdo id='ab5ar'></bdo><ul id='ab5ar'></ul>
                          • 主站蜘蛛池模板: 国产成人免费视频网站高清观看视频 | 成人欧美一区二区三区在线观看 | 欧美日韩一区二区在线 | 夜夜爽99久久国产综合精品女不卡 | 色又黄又爽网站www久久 | 黄色一级电影免费观看 | 国产女人第一次做爰毛片 | 91中文视频 | 国产丝袜一区二区三区免费视频 | 一区二区三区国产 | 国产精品永久久久久久久www | 亚洲久草视频 | 国产视频一区二区三区四区五区 | 国产激情一区二区三区 | 欧美一级久久 | 亚洲一区二区三区免费观看 | 亚洲欧美成人影院 | 亚洲 中文 欧美 日韩 在线观看 | 久久久精品 | 成人在线视频一区 | 在线成人www免费观看视频 | 日韩精品1区2区 | www.五月婷婷.com | 91在线第一页| 一区二区日本 | 黄色综合| 在线视频一区二区三区 | 亚洲精品18| 在线观看你懂的网站 | 成人免费xxxxx在线视频 | 美女国产一区 | 韩日av在线 | 久久久久国产一级毛片高清网站 | 国产精品一区久久久 | 欧美一级久久 | 久久久久国产精品www | 久久免费视频2 | 狠狠撸在线视频 | 亚洲一区二区三区四区五区午夜 | 91在线看| 国产资源在线播放 |