Pyinstaller kullanırken hata alıyorum

istersen teamvieawerla bağlan çünkü hata uzun

En başına ve sonuna ```` koyarsan problem olmaz. Mesela şöyle:

````
- - Hata - -
````

158 INFO: Python: 3.8.1
161 INFO: Platform: Windows-10-10.0.18362-SP0
162 INFO: wrote C:\Users\Python\Scripts\program.spec
179 INFO: UPX is not available.
183 INFO: Extending PYTHONPATH with paths
['C:\\Users\\Python\\Scripts', 'C:\\Users\\Python\\Scripts']
183 INFO: checking Analysis
185 INFO: Building Analysis because Analysis-00.toc is non existent
186 INFO: Initializing module dependency graph...
201 INFO: Initializing module graph hooks...
206 INFO: Analyzing base_library.zip ...
Traceback (most recent call last):
  File "<string>", line 41, in <module>
  File "<string>", line 13, in walk_packages
  File "c:\users\python\lib\pkgutil.py", line 130, in iter_modules
    for name, ispkg in iter_importer_modules(i, prefix):
  File "c:\users\python\lib\pkgutil.py", line 149, in _iter_file_finder_modules
    import inspect
  File "c:\users\python\lib\inspect.py", line 40, in <module>
    import linecache
  File "c:\users\python\lib\linecache.py", line 11, in <module>
    import tokenize
  File "c:\users\python\lib\tokenize.py", line 32, in <module>
    import re
  File "c:\users\python\lib\re.py", line 143, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Traceback (most recent call last):
  File "<string>", line 41, in <module>
  File "<string>", line 13, in walk_packages
  File "c:\users\python\lib\pkgutil.py", line 130, in iter_modules
    for name, ispkg in iter_importer_modules(i, prefix):
  File "c:\users\python\lib\pkgutil.py", line 149, in _iter_file_finder_modules
    import inspect
  File "c:\users\python\lib\inspect.py", line 40, in <module>
    import linecache
  File "c:\users\python\lib\linecache.py", line 11, in <module>
    import tokenize
  File "c:\users\python\lib\tokenize.py", line 32, in <module>
    import re
  File "c:\users\python\lib\re.py", line 143, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
7827 INFO: Processing pre-find module path hook   distutils
11606 INFO: running Analysis Analysis-00.toc
11635 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\users\python\python.exe
30543 INFO: Caching module hooks...
30552 INFO: Analyzing C:\Users\Python\Scripts\program.py
32300 INFO: Processing pre-safe import module hook   urllib3.packages.six.moves
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "c:\users\python\lib\site-packages\urllib3\__init__.py", line 7, in <module>
    from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
  File "c:\users\python\lib\site-packages\urllib3\connectionpool.py", line 3, in <module>
    import logging
  File "c:\users\python\lib\logging\__init__.py", line 26, in <module>
    import sys, os, time, io, re, traceback, warnings, weakref, collections.abc
  File "c:\users\python\lib\re.py", line 143, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
pre-safe-import-module hook failed, needs fixing.````

Komut satırına bunu yazıp tekrar deneyebilir misiniz:

pip uninstall enum34

Bu kez de

179 INFO: PyInstaller: 3.5
179 INFO: Python: 3.8.1
180 INFO: Platform: Windows-10-10.0.18362-SP0
182 INFO: wrote C:\Users\Python\Scripts\program.spec
199 INFO: UPX is not available.
202 INFO: Extending PYTHONPATH with paths
['C:\\Users\\Python\\Scripts', 'C:\\Users\\Python\\Scripts']
202 INFO: checking Analysis
203 INFO: Building Analysis because Analysis-00.toc is non existent
203 INFO: Initializing module dependency graph...
211 INFO: Initializing module graph hooks...
215 INFO: Analyzing base_library.zip ...
7537 INFO: Processing pre-find module path hook   distutils
12029 INFO: running Analysis Analysis-00.toc
12058 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\users\python\python.exe
31314 INFO: Caching module hooks...
31322 INFO: Analyzing C:\Users\Python\Scripts\program.py
32961 INFO: Processing pre-safe import module hook   urllib3.packages.six.moves
c:\users\python\lib\site-packages\selenium\webdriver\firefox\firefox_profile.py:208: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if setting is None or setting is '':
37199 INFO: Loading module hooks...
37199 INFO: Loading module hook "hook-distutils.py"...
37206 INFO: Loading module hook "hook-encodings.py"...
37406 INFO: Loading module hook "hook-lib2to3.py"...
37424 INFO: Loading module hook "hook-pydoc.py"...
37426 INFO: Loading module hook "hook-selenium.py"...
37448 INFO: Loading module hook "hook-sysconfig.py"...
37450 INFO: Loading module hook "hook-xml.dom.domreg.py"...
37452 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
37453 INFO: Loading module hook "hook-xml.py"...
37454 INFO: Loading module hook "hook-_tkinter.py"...
39575 INFO: checking Tree
39576 INFO: Building Tree because Tree-00.toc is non existent
39577 INFO: Building Tree Tree-00.toc
39874 INFO: checking Tree
39876 INFO: Building Tree because Tree-01.toc is non existent
39878 INFO: Building Tree Tree-01.toc
39963 INFO: Looking for ctypes DLLs
40024 INFO: Analyzing run-time hooks ...
40031 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
40037 INFO: Including run-time hook 'pyi_rth__tkinter.py'
40049 INFO: Looking for dynamic libraries
56767 WARNING: lib not found: pywintypes38.dll dependency of c:\users\python\lib\site-packages\win32\win32api.pyd
59086 WARNING: lib not found: pywintypes38.dll dependency of c:\users\python\lib\site-packages\win32\win32evtlog.pyd
86192 WARNING: lib not found: pywintypes38.dll dependency of c:\users\python\lib\site-packages\win32\win32wnet.pyd
117380 INFO: Looking for eggs
117380 INFO: Using Python library c:\users\python\python38.dll
117381 INFO: Found binding redirects:
[]
117391 INFO: Warnings written to C:\Users\Python\Scripts\build\program\warn-program.txt
117507 INFO: Graph cross-reference written to C:\Users\Python\Scripts\build\program\xref-program.html
117557 INFO: checking PYZ
117558 INFO: Building PYZ because PYZ-00.toc is non existent
117559 INFO: Building PYZ (ZlibArchive) C:\Users\Python\Scripts\build\program\PYZ-00.pyz
Traceback (most recent call last):
  File "c:\users\python\lib\runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\python\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\Python\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "c:\users\python\lib\site-packages\PyInstaller\__main__.py", line 111, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\users\python\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\users\python\lib\site-packages\PyInstaller\building\build_main.py", line 844, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "c:\users\python\lib\site-packages\PyInstaller\building\build_main.py", line 791, in build
    exec(code, spec_namespace)
  File "C:\Users\Python\Scripts\program.spec", line 18, in <module>
    pyz = PYZ(a.pure, a.zipped_data,
  File "c:\users\python\lib\site-packages\PyInstaller\building\api.py", line 98, in __init__
    self.__postinit__()
  File "c:\users\python\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
    self.assemble()
  File "c:\users\python\lib\site-packages\PyInstaller\building\api.py", line 128, in assemble
    self.code_dict = {
  File "c:\users\python\lib\site-packages\PyInstaller\building\api.py", line 129, in <dictcomp>
    key: strip_paths_in_code(code)
  File "c:\users\python\lib\site-packages\PyInstaller\building\utils.py", line 652, in strip_paths_in_code
    consts = tuple(
  File "c:\users\python\lib\site-packages\PyInstaller\building\utils.py", line 653, in <genexpr>
    strip_paths_in_code(const_co, new_filename)
  File "c:\users\python\lib\site-packages\PyInstaller\building\utils.py", line 652, in strip_paths_in_code
    consts = tuple(
  File "c:\users\python\lib\site-packages\PyInstaller\building\utils.py", line 653, in <genexpr>
    strip_paths_in_code(const_co, new_filename)
  File "c:\users\python\lib\site-packages\PyInstaller\building\utils.py", line 660, in strip_paths_in_code
    return code_func(co.co_argcount, co.co_kwonlyargcount, co.co_nlocals, co.co_stacksize,
TypeError: an integer is required (got type bytes)

bu hatayı aldım ve

xref-program.html
warn-program.txt
Tree-01.toc
Tree-00.toc
program.exe.manifest
base_library.zip
Analysis-00.toc

dosyaları oluştu

Problem Pyinstaller’ın henüz Python3.8’i desteklememesinden kaynaklanıyor. Şu anlık en iyi çözüm Python3.7 kullanmak.

Ama eğer istiyorsanız stabil olmayan sürümü deneyebilirsiniz:

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz
1 Beğeni

yardımın için saol agam mecbur desteklenmesini bekliyicem

Pyinstaller Python ekibi tarafından mı gelistirldi

Veya Python ekibi tarafından geliştirilen başka bir derleyici yokmu

Hayır, zaten öyle olsaydı büyük ihtimalle standart kütüphaneye dahil olurdu ve desteklememe problemi olmazdı.

Python derlenen bir dil değil ki, yorumlanan bir dil. Onun için de CPython var.

1 Beğeni

Peki eğer pyinstaller olmasaydı Python ile yapılan uygulamaları exe haline getiremezmiydik

Başka kütüphaneler de var, zaten bu kütüphanelerin yaptığı iş CPythonu ve kodlarımızı bir uygulamaya gömmek.

En iyi yöntemin bu olduğundan dolayı mı bunu kullanıyorlar ve kodları uygulamaya gomdugumuzde çalışırken uygulamam veri tiplerini nasıl kontrol ediyor hani Python dinamik tipliya

Bilmem, çok bilinen bir kütüphane ise bir sebebi vardır herhalde.

Anlatamadım sanırım, bizim python.exe var ya hani normalde betiklerimizi birlikte açtığımız; bu program ve bunun ihtiyaç duyacağı bütün gereklilikler bir uygulama içinde toplanıyor. Sonra da kodumuz bunun içine gömülüyor. Aslında CPython’u bizim kodumuzu çalıştıracak tek bir uygulama haline getirmiş oluyoruz.

Geçenlerde adam pyinstaller ile exe haline getirdiği uygulamayı çalıştığında iki tane uygulama çalışıyormuş gibi görünüyordu adam neden diye sordu değişkenlerin tiplerini kontrol etmek için dediler

Ne demek istidiğinizi anlamadım; hangi adam, nerede?


PyInstaller reads a Python script written by you. It analyzes your code to discover every other module and library your script needs in order to execute. Then it collects copies of all those files – including the active Python interpreter! – and puts them with your script in a single folder, or optionally in a single executable file.

https://pythonhosted.org/PyInstaller/operating-mode.html

Bu forumda ama hangisi hatırlamıyorum neyse ilgilendiğiniz için saolun

Bulursanız atın merak ettim.

Şundan mı bahsediyorsunuz?

Onun bunla alakası yok ama.