overgil
(usa Nenhuma)
Enviado em 13/01/2022 - 09:14h
Olá, sou iniciante em Python e me deparei com um erro de compilação:
Quando mando executar o comando pyinstallaer --onefile index.py
PS C:\pythonProject\projeto_avanco> pyinstaller --onefile index.py
299 INFO: PyInstaller: 4.8
11688 INFO: Caching module dependency graph...
12127 INFO: running Analysis Analysis-00.toc
12131 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by C:\Program Files\Python310\python.exe
12299 INFO: Analyzing C:\pythonProject\projeto_avanco\index.py
13941 INFO: Processing pre-find module path hook site from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_mod
ule_path\\hook-site.py'.
13942 INFO: site: retargeting to fake-dir 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\fake-modules'
21876 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstal
ler\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
26543 INFO: Processing module hooks...
26547 INFO: Loading module hook 'hook-certifi.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\s
tdhooks'...
26587 INFO: Loading module hook 'hook-cv2.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdho
oks'...
26641 INFO: Loading module hook 'hook-difflib.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
26656 INFO: Loading module hook 'hook-distutils.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
26662 INFO: Loading module hook 'hook-distutils.util.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
26669 INFO: Loading module hook 'hook-encodings.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
27096 INFO: Loading module hook 'hook-heapq.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
27101 INFO: Loading module hook 'hook-lib2to3.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
27725 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
27732 INFO: Loading module hook 'hook-numpy.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
28047 INFO: Import to be excluded not found: 'f2py'
28127 INFO: Loading module hook 'hook-numpy._pytesttester.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
28132 INFO: Loading module hook 'hook-pickle.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
28146 INFO: Loading module hook 'hook-pkg_resources.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
29387 INFO: Processing pre-safe import module hook win32com from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\_pyinstaller_hooks_contrib
\\hooks\\pre_safe_import_module\\hook-win32com.py'.
30272 WARNING: Hidden import "pkg_resources.py2_warn" not found!
30308 WARNING: Hidden import "pkg_resources.markers" not found!
30345 INFO: Loading module hook 'hook-setuptools.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
34158 INFO: Loading module hook 'hook-sysconfig.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
34159 INFO: Loading module hook 'hook-win32ctypes.core.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
34647 INFO: Loading module hook 'hook-xml.dom.domreg.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
34648 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'..
.
34649 INFO: Loading module hook 'hook-xml.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
34652 INFO: Loading module hook 'hook-_tkinter.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
35072 INFO: checking Tree
35073 INFO: Building Tree because Tree-00.toc is non existent
35074 INFO: Building Tree Tree-00.toc
35233 INFO: checking Tree
35234 INFO: Building Tree because Tree-01.toc is non existent
35234 INFO: Building Tree Tree-01.toc
35420 INFO: checking Tree
35421 INFO: Building Tree because Tree-02.toc is non existent
35421 INFO: Building Tree Tree-02.toc
35430 INFO: Loading module hook 'hook-setuptools.msvc.py' from 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks'...
35482 INFO: Looking for ctypes DLLs
35626 INFO: Analyzing run-time hooks ...
35631 INFO: Including run-time hook 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py'
35636 INFO: Including run-time hook 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_subprocess.py'
35641 INFO: Including run-time hook 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgutil.py'
35647 INFO: Including run-time hook 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py
'
35656 INFO: Including run-time hook 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgres.py'
35663 INFO: Including run-time hook 'c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth__tkinter.py'
35684 INFO: Looking for dynamic libraries
36690 INFO: Looking for eggs
36690 INFO: Using Python library C:\Program Files\Python310\python310.dll
36691 INFO: Found binding redirects:
[]
36701 INFO: Warnings written to C:\pythonProject\projeto_avanco\build\index\warn-index.txt
36857 INFO: Graph cross-reference written to C:\pythonProject\projeto_avanco\build\index\xref-index.html
36930 INFO: checking PYZ
36930 INFO: Building PYZ because PYZ-00.toc is non existent
36930 INFO: Building PYZ (ZlibArchive) C:\pythonProject\projeto_avanco\build\index\PYZ-00.pyz
38694 INFO: Building PYZ (ZlibArchive) C:\pythonProject\projeto_avanco\build\index\PYZ-00.pyz completed successfully.
38731 INFO: checking PKG
38732 INFO: Building PKG because PKG-00.toc is non existent
38738 INFO: Building PKG (CArchive) index.pkg
71864 INFO: Building PKG (CArchive) index.pkg completed successfully.
71993 INFO: Bootloader c:\users\venom\pycharmprojects\projeto_avanco\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
72015 INFO: checking EXE
72025 INFO: Building EXE because EXE-00.toc is non existent
72025 INFO: Building EXE from EXE-00.toc
72025 INFO: Copying bootloader EXE to C:\pythonProject\projeto_avanco\dist\index.exe
72035 INFO: Copying icon to EXE
72035 INFO: Copying icons from ['c:\\users\\venom\\pycharmprojects\\projeto_avanco\\lib\\site-packages\\PyInstaller\\bootloader\\images\\icon-console.ico']
72035 INFO: Writing RT_GROUP_ICON 0 resource with 104 bytes
72035 INFO: Writing RT_ICON 1 resource with 3752 bytes
72035 INFO: Writing RT_ICON 2 resource with 2216 bytes
72035 INFO: Writing RT_ICON 3 resource with 1384 bytes
72043 INFO: Writing RT_ICON 4 resource with 37019 bytes
72043 INFO: Writing RT_ICON 5 resource with 9640 bytes
72043 INFO: Writing RT_ICON 6 resource with 4264 bytes
72044 INFO: Writing RT_ICON 7 resource with 1128 bytes
72046 INFO: Copying 0 resources to EXE
72054 INFO: Emedding manifest in EXE
72056 INFO: Updating manifest in C:\pythonProject\projeto_avanco\dist\index.exe
72056 INFO: Updating resource type 24 name 1 language 0
72066 INFO: Appending PKG archive to EXE
120288 INFO: Building EXE from EXE-00.toc completed successfully.
PS C:\pythonProject\projeto_avanco>
Quando executo o arquivo index.ex recebe o seguinte erro no terminal
Traceback (most recent call last):
File "idex.py" line 21, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
File "PyInstaller\loader\pyimod03_importes.py", line 476, in exec_module
File "src\logger.py", line 7, in <module>
FileNotFoundError: [Errno 2] No such file or directory: './config.yaml'
[5648] Failed to execute script 'index' due to unhandled exception!
Não consigo solucionar esse problema e precisa de ajuda!
Obrigado a todos.