Alpersamur1234567890
Hectopat
- Katılım
- 10 Mayıs 2020
- Mesajlar
- 127
Python'da kodladığım programı EXE'ye çevirmek istiyorum. Bir sitede yazanları yaptım ama hata verdi. Sırayla yaptığım şeyler;
İlk önce komut sistemini yani CMD'yi açtım. Sonra 'cd C:\Users\HP\AppData\Local\Programs\Python\Python38-32\Scripts' böyle yazdım komut sistemine.
Ardından şu komutla pip'ten pyinstaller'i indirdim:
'pip install pyinstaller'
Sonra şu komutu yazdım;
pyinstaller.exe --onefile -windowed C:\Users\HP\Desktop\python\mrb.py (rastgele bir program seçtim denemek amacıyla)
Sonra şu çıktıyı verdi. En sonunda ve içinde hatalar yer alıyor;
Burada neden hata var ya da nasıl PY dosyasını EXE'ye çeviririm?
İlk önce komut sistemini yani CMD'yi açtım. Sonra 'cd C:\Users\HP\AppData\Local\Programs\Python\Python38-32\Scripts' böyle yazdım komut sistemine.
Ardından şu komutla pip'ten pyinstaller'i indirdim:
'pip install pyinstaller'
Sonra şu komutu yazdım;
pyinstaller.exe --onefile -windowed C:\Users\HP\Desktop\python\mrb.py (rastgele bir program seçtim denemek amacıyla)
Sonra şu çıktıyı verdi. En sonunda ve içinde hatalar yer alıyor;
Kod:
208 INFO: PyInstaller: 3.6
208 INFO: Python: 3.8.3
212 INFO: Platform: Windows-10-10.0.18362-SP0
216 INFO: wrote C:\Users\HP\AppData\Local\Programs\Python\Python38-32\Scripts\mrb.spec
222 INFO: UPX is not available.
240 INFO: Extending PYTHONPATH with paths
['C:\\Users\\HP\\Desktop\\python',
'C:\\Users\\HP\\AppData\\Local\\Programs\\Python\\Python38-32\\Scripts']
242 INFO: checking Analysis
245 INFO: Building Analysis because Analysis-00.toc is non existent
246 INFO: Initializing module dependency graph...
256 INFO: Caching module graph hooks...
282 INFO: Analyzing base_library.zip ...
5759 INFO: Processing pre-find module path hook distutils
5763 INFO: distutils: retargeting to non-venv dir 'c:\\users\\hp\\appdata\\local\\programs\\python\\python38-32\\lib'
11786 INFO: Caching module dependency graph...
12107 INFO: running Analysis Analysis-00.toc
12115 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\hp\appdata\local\programs\python\python38-32\python.exe
12284 INFO: Analyzing C:\Users\HP\Desktop\python\mrb.py
12293 INFO: Processing module hooks...
12294 INFO: Loading module hook "hook-distutils.py"...
12301 INFO: Loading module hook "hook-encodings.py"...
12493 INFO: Loading module hook "hook-lib2to3.py"...
12509 INFO: Loading module hook "hook-pydoc.py"...
12513 INFO: Loading module hook "hook-sysconfig.py"...
12520 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
12527 INFO: Loading module hook "hook-xml.py"...
12664 INFO: Loading module hook "hook-_tkinter.py"...
12969 INFO: checking Tree
12970 INFO: Building Tree because Tree-00.toc is non existent
12974 INFO: Building Tree Tree-00.toc
13147 INFO: checking Tree
13151 INFO: Building Tree because Tree-01.toc is non existent
13151 INFO: Building Tree Tree-01.toc
13252 INFO: Looking for ctypes DLLs
13337 INFO: Analyzing run-time hooks ...
13347 INFO: Including run-time hook 'pyi_rth__tkinter.py'
13352 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
13377 INFO: Looking for dynamic libraries
14097 INFO: Looking for eggs
14097 INFO: Using Python library c:\users\hp\appdata\local\programs\python\python38-32\python38.dll
14103 INFO: Found binding redirects:
[]
14115 INFO: Warnings written to C:\Users\HP\AppData\Local\Programs\Python\Python38-32\Scripts\build\mrb\warn-mrb.txt
14264 INFO: Graph cross-reference written to C:\Users\HP\AppData\Local\Programs\Python\Python38-32\Scripts\build\mrb\xref-mrb.html
14374 INFO: checking PYZ
14375 INFO: Building PYZ because PYZ-00.toc is non existent
14378 INFO: Building PYZ (ZlibArchive) C:\Users\HP\AppData\Local\Programs\Python\Python38-32\Scripts\build\mrb\PYZ-00.pyz
15831 INFO: Building PYZ (ZlibArchive) C:\Users\HP\AppData\Local\Programs\Python\Python38-32\Scripts\build\mrb\PYZ-00.pyz completed successfully.
15889 INFO: checking PKG
15893 INFO: Building PKG because PKG-00.toc is non existent
15893 INFO: Building PKG (CArchive) PKG-00.pkg
19503 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
19589 INFO: Bootloader c:\users\hp\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\runw.exe
19593 INFO: checking EXE
19594 INFO: Building EXE because EXE-00.toc is non existent
19596 INFO: Building EXE from EXE-00.toc
19602 INFO: Copying icons from C:\Users\HP\AppData\Local\Programs\Python\Python38-32\Scripts\ndowed
Traceback (most recent call last):
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 35, in pywin32error
yield
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\site-packages\win32ctypes\pywin32\win32api.py", line 43, in LoadLibraryEx
return _dll._LoadLibraryEx(fileName, 0, flags)
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\site-packages\win32ctypes\core\ctypes\_util.py", line 42, in check_null
raise make_error(function, function_name)
OSError: [WinError 2] Sistem belirtilen dosyayı bulamıyor.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\utils\win32\icon.py", line 233, in CopyIcons
hsrc = win32api.LoadLibraryEx(srcpath, 0, LOAD_LIBRARY_AS_DATAFILE)
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\site-packages\win32ctypes\pywin32\win32api.py", line 43, in LoadLibraryEx
return _dll._LoadLibraryEx(fileName, 0, flags)
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 37, in pywin32error
raise error(exception.winerror, exception.function, exception.strerror)
win32ctypes.pywin32.pywintypes.error: (2, 'LoadLibraryExW', 'Sistem belirtilen dosyayı bulamıyor.')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\Scripts\pyinstaller.exe\__main__.py", line 9, in <module>
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\__main__.py", line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\build_main.py", line 734, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\build_main.py", line 681, in build
exec(code, spec_namespace)
File "C:\Users\HP\AppData\Local\Programs\Python\Python38-32\Scripts\mrb.spec", line 20, in <module>
exe = EXE(pyz,
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\api.py", line 445, in __init__
self.__postinit__()
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\datastruct.py", line 160, in __postinit__
self.assemble()
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\api.py", line 539, in assemble
icon.CopyIcons(tmpnm, self.icon)
File "c:\users\hp\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\utils\win32\icon.py", line 234, in CopyIcons
except win32api.error as W32E:
AttributeError: module 'win32ctypes.pywin32.win32api' has no attribute 'error'
Burada neden hata var ya da nasıl PY dosyasını EXE'ye çeviririm?