Pyinstaller给了我一个无法正常运行的exe

如何解决Pyinstaller给了我一个无法正常运行的exe

我想使用pyinstaller将py代码转换为exe。我是在Ubuntu上制作的,效果很好。现在,我想在Windows上构建我的应用程序,但是pyinstaller创建了一个无法正常工作的.exe文件,更好的是,一旦我启动它,它就会崩溃,因此尝试打开一个立即关闭的窗口。我试图构建一个简单的“ Hello world”,并且它可以正常工作。我不知道为什么它不起作用,这是我的规格文件

# -*- mode: python ; coding: utf-8 -*-
from kivy_deps import sdl2,glew,gstreamer

block_cipher = None


a = Analysis(['YouTube2mp3.py'],pathex=['C:\\Users\\samto\\Documenti'],binaries=[],datas=[('ffmpeg.exe','ffmpeg.exe')],hiddenimports=[],hookspath=[],runtime_hooks=[],excludes=[],win_no_prefer_redirects=False,win_private_assemblies=False,cipher=block_cipher,noarchive=False)
pyz = PYZ(a.pure,a.zipped_data,cipher=block_cipher)
exe = EXE(pyz,Tree('C:\\Users\\samto\\Documenti'),a.scripts,[],exclude_binaries=True,name='YouTube2mp3',debug=False,bootloader_ignore_signals=False,*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins + gstreamer.dep_bins)],strip=False,upx=True,console=True )
coll = COLLECT(exe,a.binaries,a.zipfiles,a.datas,upx_exclude=[],name='YouTube2mp3')

这是我的代码:

from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.textinput import TextInput
from kivy.uix.popup import Popup


from pydub import AudioSegment
from pytube import YouTube
import os
import threading

class YouTube2mp3App(App):
    
        
    def build(self):

        self.mylayout = FloatLayout()
        mylabel = Label(text= "Benvenuto su YouTube2mp3!\nInserisci il link e premi converti",size_hint=(.8,.2),pos_hint={"x":.1,"y":.7},font_size=20)
        self.txt = TextInput(hint_text="Incolla qui",size_hint=(.9,.1),pos_hint={"x":.05,"y":.4})
        self.pb = Label(text="","y":.1},font_size=20)
        mybutton =Button(text="Nuovo/i video",on_press= self.clearText,size_hint=(.45,pos_hint={"x":.5,"y":.3})  
        mybutton2 =Button(text="Converti",on_press= self.callback,"y":.3}) 
        self.mylayout.add_widget(mylabel)
        self.mylayout.add_widget(self.txt)
        self.mylayout.add_widget(self.pb)
        self.mylayout.add_widget(mybutton)
        self.mylayout.add_widget(mybutton2)
        return self.mylayout

    def clearText(self,instance):
        #clear input
        self.txt.text = ''

    def callback(self,instance):
        self.pb.text="Convertendo..."
        self.t = threading.Thread(target = self.convert)
        self.t.start()

    def convert(self):
        #try:

        #starting to convert using 3 methods    
            ns=self.check_spazio(self.txt.text)

            
            links=self.list_of_links(ns)
            
            
            self.Tube(links)
            content = Button(text='Chiudi',size_hint=(.3,.7))
            popup = Popup(title="Fatto!",content=content,auto_dismiss=False,.2))
            
            content.bind(on_press=popup.dismiss)
            popup.open()
            self.pb.text=""
#       except:
#           content = Button(text='Chiudi',.7))
#           popup = Popup(title="Link non valido",.2))
#           content.bind(on_press=popup.dismiss)
#           popup.open()
#           self.pb.text=""

    def Tube(self,lista):
        #convert
        #AudioSegment.convert = r"C:\\Users\\samto\\Documents\\ffmepg\\bin\\ffmpeg.exe"
        for text in lista:
            yt=YouTube(text)
            ys=yt.streams.get_audio_only()

            file=ys.download()
            ya=file[:-1]+"3"
            AudioSegment.from_file(file).export(ya,format="mp3")
            os.remove(file)

    def check_spazio(self,string):
        #check space between input string 
        s=list(string)
        strig=[]
        for i in s:
            if i!=" ":
                strig.append(i) 
        string = "".join(strig)
        return string

    def list_of_links(self,string):
        #create a list of strings. Each string is a link
        prev=0
        links=[]
        for i in range (len(string)):
            if string[i]=="\n" or string[i]==",":
                links.append(string[prev:i])
                prev=i+1
            elif i==len(string)-1:
                links.append(string[prev:i+1])
        return links

if __name__ == '__main__':
    a=True
    YouTube2mp3App().run()
    while a==True:
        pass

当我按照kivy文档的说明构建规范文件时,我会得到此信息:

C:\Users\samto\Documenti>python -m PyInstaller YouTube2mp3.spec
141 INFO: PyInstaller: 4.0
141 INFO: Python: 3.7.0
142 INFO: Platform: Windows-10-10.0.18362-SP0
148 INFO: UPX is not available.
163 INFO: Extending PYTHONPATH with paths
['C:\\Users\\samto\\Documenti']
393 INFO: checking Analysis
453 INFO: Building because pathex changed
453 INFO: Initializing module dependency graph...
460 INFO: Caching module graph hooks...
510 INFO: Analyzing base_library.zip ...
10864 INFO: Caching module dependency graph...
11095 INFO: running Analysis Analysis-00.toc
11139 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by C:\Users\samto\AppData\Local\Programs\Python\Python37\python.exe
11334 INFO: Analyzing YouTube2mp3.py
14552 INFO: Processing pre-find module path hook distutils from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
14556 INFO: distutils: retargeting to non-venv dir 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib'
20025 INFO: Processing module hooks...
20026 INFO: Loading module hook 'hook-distutils.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks'...
20032 INFO: Loading module hook 'hook-encodings.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks'...
20228 INFO: Loading module hook 'hook-kivy.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks'...
[INFO   ] [Logger      ] Record log in C:\Users\samto\.kivy\logs\kivy_20-09-07_23.txt
20296 INFO: [Logger      ] Record log in C:\Users\samto\.kivy\logs\kivy_20-09-07_23.txt
[INFO   ] [deps        ] Successfully imported "kivy_deps.gstreamer" 0.1.18
20291 INFO: [deps        ] Successfully imported "kivy_deps.gstreamer" 0.1.18
[INFO   ] [deps        ] Successfully imported "kivy_deps.angle" 0.1.10
20303 INFO: [deps        ] Successfully imported "kivy_deps.angle" 0.1.10
[INFO   ] [deps        ] Successfully imported "kivy_deps.glew" 0.1.12
20306 INFO: [deps        ] Successfully imported "kivy_deps.glew" 0.1.12
[INFO   ] [deps        ] Successfully imported "kivy_deps.sdl2" 0.1.23
20309 INFO: [deps        ] Successfully imported "kivy_deps.sdl2" 0.1.23
[INFO   ] [Kivy        ] v1.11.1
20313 INFO: [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\kivy\__init__.py"
20316 INFO: [Kivy        ] Installed at "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\kivy\__init__.py"
[INFO   ] [Python      ] v3.7.0 (v3.7.0:1bf9cc5093,Jun 27 2018,04:59:51) [MSC v.1914 64 bit (AMD64)]
20318 INFO: [Python      ] v3.7.0 (v3.7.0:1bf9cc5093,04:59:51) [MSC v.1914 64 bit (AMD64)]
[INFO   ] [Python      ] Interpreter at "C:\Users\samto\AppData\Local\Programs\Python\Python37\python.exe"
20325 INFO: [Python      ] Interpreter at "C:\Users\samto\AppData\Local\Programs\Python\Python37\python.exe"
[INFO   ] [Factory     ] 184 symbols loaded
20343 INFO: [Factory     ] 184 symbols loaded
[INFO   ] [Logger      ] Record log in C:\Users\samto\.kivy\logs\kivy_20-09-07_24.txt
[INFO   ] [deps        ] Successfully imported "kivy_deps.gstreamer" 0.1.18
[INFO   ] [deps        ] Successfully imported "kivy_deps.angle" 0.1.10
[INFO   ] [deps        ] Successfully imported "kivy_deps.glew" 0.1.12
[INFO   ] [deps        ] Successfully imported "kivy_deps.sdl2" 0.1.23
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\kivy\__init__.py"
[INFO   ] [Python      ] v3.7.0 (v3.7.0:1bf9cc5093,04:59:51) [MSC v.1914 64 bit (AMD64)]
[INFO   ] [Python      ] Interpreter at "C:\Users\samto\AppData\Local\Programs\Python\Python37\python.exe"
[INFO   ] [Image       ] Providers: img_tex,img_dds,img_sdl2,img_gif (img_pil,img_ffpyplayer ignored)
[WARNING] [Could not find GStreamer plugins. Possible solution] set GST_PLUGIN_PATH
21626 WARNING: [Could not find GStreamer plugins. Possible solution] set GST_PLUGIN_PATH
[INFO   ] [Logger      ] Record log in C:\Users\samto\.kivy\logs\kivy_20-09-07_25.txt
[INFO   ] [deps        ] Successfully imported "kivy_deps.gstreamer" 0.1.18
[INFO   ] [deps        ] Successfully imported "kivy_deps.angle" 0.1.10
[INFO   ] [deps        ] Successfully imported "kivy_deps.glew" 0.1.12
[INFO   ] [deps        ] Successfully imported "kivy_deps.sdl2" 0.1.23
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\kivy\__init__.py"
[INFO   ] [Python      ] v3.7.0 (v3.7.0:1bf9cc5093,04:59:51) [MSC v.1914 64 bit (AMD64)]
[INFO   ] [Python      ] Interpreter at "C:\Users\samto\AppData\Local\Programs\Python\Python37\python.exe"
[INFO   ] [AudioGstplayer] Using Gstreamer 1.16.0.0
[INFO   ] [Audio       ] Providers: audio_gstplayer,audio_sdl2 (audio_ffpyplayer ignored)
[INFO   ] [Image       ] Providers: img_tex,img_ffpyplayer ignored)
[INFO   ] [Camera      ] Provider: opencv(['camera_picamera','camera_gi'] ignored)
[INFO   ] [Clipboard   ] Provider: winctypes
[INFO   ] [Factory     ] 184 symbols loaded
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] GLEW initialization succeeded
[INFO   ] [GL          ] Backend used <glew>
[INFO   ] [GL          ] OpenGL version <b'4.5.0 - Build 23.20.16.4849'>
[INFO   ] [GL          ] OpenGL vendor <b'Intel'>
[INFO   ] [GL          ] OpenGL renderer <b'Intel(R) HD Graphics 630'>
[INFO   ] [GL          ] OpenGL parsed version: 4,5
[INFO   ] [GL          ] Shading version <b'4.50 - Build 23.20.16.4849'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <32>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed,single mode,not docked
[INFO   ] [Spelling    ] Provider: enchant
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [VideoGstplayer] Using Gstreamer 1.16.0.0
[INFO   ] [Video       ] Provider: gstplayer
31989 INFO: Processing pre-find module path hook site from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-site.py'.
31991 INFO: site: retargeting to fake-dir 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\fake-modules'
46282 INFO: Import to be excluded not found: '_tkinter'
46283 INFO: Excluding import 'twisted'
46292 INFO:   Removing import of twisted from module kivy.support
46296 INFO: Import to be excluded not found: 'tkinter'
46297 INFO: Loading module hook 'hook-lib2to3.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks'...
46443 INFO: Loading module hook 'hook-numpy.core.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks'...
46712 INFO: Loading module hook 'hook-numpy.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks'...
46719 INFO: Loading module hook 'hook-pkg_resources.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks'...
47748 INFO: Processing pre-safe import module hook win32com from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\pre_safe_import_module\\hook-win32com.py'.
48478 WARNING: Hidden import "pkg_resources.py2_warn" not found!
48479 WARNING: Hidden import "pkg_resources.markers" not found!
48485 INFO: Excluding import '__main__'
48487 INFO:   Removing import of __main__ from module pkg_resources
48488 INFO: Loading module hook 'hook-pygments.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks'...
54698 INFO: Loading module hook 'hook-setuptools.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks'...
56076 INFO: Loading module hook 'hook-sysconfig.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks'...
56080 INFO: Loading module hook 'hook-xml.dom.domreg.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks'...
56082 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks'...
56084 INFO: Loading module hook 'hook-xml.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks'...
56087 INFO: Loading module hook 'hook-cv2.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
56099 INFO: Loading module hook 'hook-docutils.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
60374 INFO: Loading module hook 'hook-enchant.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
60559 INFO: Import to be excluded not found: 'enchant.tests'
60559 INFO: Loading module hook 'hook-pythoncom.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
61055 INFO: Loading module hook 'hook-pywintypes.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
61656 INFO: Loading module hook 'hook-win32com.py' from 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
63053 INFO: Looking for ctypes DLLs
63129 INFO: Analyzing run-time hooks ...
63138 INFO: Including run-time hook 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_kivy.py'
63149 INFO: Including run-time hook 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgres.py'
63160 INFO: Including run-time hook 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py'
63176 INFO: Including run-time hook 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_win32comgenpy.py'
63192 INFO: Including run-time hook 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_gstreamer.py'
63206 INFO: Including run-time hook 'C:\\Users\\samto\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\rthooks\\pyi_rth_enchant.py'
63261 INFO: Looking for dynamic libraries
63734 WARNING: lib not found: libgcc_s_seh-1.dll dependency of C:\Users\samto\AppData\Roaming\Python\Python37\site-packages\enchant\data\mingw64\lib\enchant-2\enchant_hunspell.dll
63786 WARNING: lib not found: libhunspell-1.6-0.dll dependency of C:\Users\samto\AppData\Roaming\Python\Python37\site-packages\enchant\data\mingw64\lib\enchant-2\enchant_hunspell.dll
63791 WARNING: lib not found: libenchant-2.dll dependency of C:\Users\samto\AppData\Roaming\Python\Python37\site-packages\enchant\data\mingw64\lib\enchant-2\enchant_hunspell.dll
63796 WARNING: lib not found: libglib-2.0-0.dll dependency of C:\Users\samto\AppData\Roaming\Python\Python37\site-packages\enchant\data\mingw64\lib\enchant-2\enchant_hunspell.dll
63862 WARNING: lib not found: libffi-6.dll dependency of C:\Users\samto\AppData\Roaming\Python\Python37\site-packages\enchant\data\mingw64\bin\libp11-kit-0.dll
64242 WARNING: lib not found: libffi-6.dll dependency of C:\Users\samto\AppData\Roaming\Python\Python37\site-packages\enchant\data\mingw64\bin\libgobject-2.0-0.dll
66849 INFO: Looking for eggs
66850 INFO: Using Python library C:\Users\samto\AppData\Local\Programs\Python\Python37\python37.dll
66850 INFO: Found binding redirects:
[]
66864 INFO: Warnings written to C:\Users\samto\Documenti\build\YouTube2mp3\warn-YouTube2mp3.txt
67039 INFO: Graph cross-reference written to C:\Users\samto\Documenti\build\YouTube2mp3\xref-YouTube2mp3.html
67129 INFO: Appending 'datas' from .spec
67141 INFO: checking PYZ
67185 INFO: Building because name changed
67185 INFO: Building PYZ (ZlibArchive) C:\Users\samto\Documenti\build\YouTube2mp3\PYZ-00.pyz
69450 INFO: Building PYZ (ZlibArchive) C:\Users\samto\Documenti\build\YouTube2mp3\PYZ-00.pyz completed successfully.
69488 INFO: checking Tree
70165 INFO: Building because root changed
70166 INFO: Building Tree Tree-00.toc
 Traceback (most recent call last):
70168 WARNING: stderr: Traceback (most recent call last):
   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\runpy.py",line 193,in _run_module_as_main
70171 WARNING: stderr:   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\runpy.py",in _run_module_as_main
     "__main__",mod_spec)
70173 WARNING: stderr:     "__main__",mod_spec)
   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\runpy.py",line 85,in _run_code
70174 WARNING: stderr:   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\runpy.py",in _run_code
     exec(code,run_globals)
70178 WARNING: stderr:     exec(code,run_globals)
   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\__main__.py",line 121,in <module>
70180 WARNING: stderr:   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\__main__.py",in <module>
     run()
70194 WARNING: stderr:     run()
   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\__main__.py",line 114,in run
70195 WARNING: stderr:   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\__main__.py",in run
     run_build(pyi_config,spec_file,**vars(args))
70199 WARNING: stderr:     run_build(pyi_config,**vars(args))
   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\__main__.py",line 65,in run_build
70203 WARNING: stderr:   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\__main__.py",in run_build
     PyInstaller.building.build_main.main(pyi_config,**kwargs)
70205 WARNING: stderr:     PyInstaller.building.build_main.main(pyi_config,**kwargs)
   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\building\build_main.py",line 720,in main
70209 WARNING: stderr:   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\building\build_main.py",in main
     build(specfile,kw.get('distpath'),kw.get('workpath'),kw.get('clean_build'))
70227 WARNING: stderr:     build(specfile,kw.get('clean_build'))
   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\building\build_main.py",line 667,in build
70230 WARNING: stderr:   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\building\build_main.py",in build
     exec(code,spec_namespace)
70235 WARNING: stderr:     exec(code,spec_namespace)
   File "YouTube2mp3.spec",line 21,in <module>
70235 WARNING: stderr:   File "YouTube2mp3.spec",in <module>
     exe = EXE(pyz,70238 WARNING: stderr:     exe = EXE(pyz,File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\building\datastruct.py",line 220,in __init__
70244 WARNING: stderr:   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\building\datastruct.py",in __init__
     self.__postinit__()
70261 WARNING: stderr:     self.__postinit__()
   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\building\datastruct.py",line 160,in __postinit__
70264 WARNING: stderr:   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\building\datastruct.py",in __postinit__
     self.assemble()
70270 WARNING: stderr:     self.assemble()
   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\building\datastruct.py",line 272,in assemble
70272 WARNING: stderr:   File "C:\Users\samto\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\building\datastruct.py",in assemble
     for filename in os.listdir(dir):
70279 WARNING: stderr:     for filename in os.listdir(dir):
 PermissionError: [WinError 5] Accesso negato: 'C:\\Users\\samto\\Documenti'
70283 WARNING: stderr: PermissionError: [WinError 5] Accesso negato: 'C:\\Users\\samto\\Documenti'

即使我以管理员身份打开提示,我也会得到此提示。

编辑:如果我从提示符运行它,我得到这个:

C:\Users\samto\Documenti\dist\YouTube2mp3>YouTube2mp3.exe
[INFO   ] [Logger      ] Record log in C:\Users\samto\.kivy\logs\kivy_20-09-08_0.txt
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "C:\Users\samto\Documenti\dist\YouTube2mp3\kivy\__init__.pyc"
[INFO   ] [Python      ] v3.7.0 (v3.7.0:1bf9cc5093,04:59:51) [MSC v.1914 64 bit (AMD64)]
[INFO   ] [Python      ] Interpreter at "C:\Users\samto\Documenti\dist\YouTube2mp3\YouTube2mp3.exe"
[INFO   ] [Factory     ] 184 symbols loaded
[INFO   ] [Image       ] Providers: img_tex,img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: sdl2
 C:\Users\samto\Documenti\dist\YouTube2mp3\pydub\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg,but may not work
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] GLEW initialization succeeded
[INFO   ] [GL          ] Backend used <glew>
[INFO   ] [GL          ] OpenGL version <b'4.5.0 - Build 23.20.16.4849'>
[INFO   ] [GL          ] OpenGL vendor <b'Intel'>
[INFO   ] [GL          ] OpenGL renderer <b'Intel(R) HD Graphics 630'>
[INFO   ] [GL          ] OpenGL parsed version: 4,5
[INFO   ] [GL          ] Shading version <b'4.50 - Build 23.20.16.4849'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <32>
[WARNING] [Image       ] Unable to load image <C:\Users\samto\Documenti\dist\YouTube2mp3\kivy_install\data\glsl\default.png>
[CRITICAL] [Window      ] Unable to find any valuable Window provider. Please enable debug logging (e.g. add -d if running from the command line,or change the log level in the config) and re-run your app to identify potential causes
sdl2 - Exception: SDL2: Unable to load image
  File "kivy\core\__init__.py",line 71,in core_select_lib
  File "kivy\core\window\window_sdl2.py",line 152,in __init__
  File "kivy\core\window\__init__.py",line 981,in __init__
  File "kivy\core\window\window_sdl2.py",line 312,in create_window
  File "kivy\core\window\__init__.py",line 1258,in create_window
  File "kivy\graphics\instructions.pyx",line 783,in kivy.graphics.instructions.RenderContext.__init__
  File "kivy\core\image\__init__.py",line 561,in __init__
  File "kivy\core\image\__init__.py",line 756,in _set_filename
  File "kivy\core\image\__init__.py",line 460,in load
  File "kivy\core\image\__init__.py",line 223,in __init__
  File "kivy\core\image\img_sdl2.py",line 47,in load

[CRITICAL] [App         ] Unable to get a Window,abort.

解决方法

尝试这个python -m PyInstaller --onefile --windowed YouTube2mp3.spec

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-