2019年12月30日

pip install pyinstaller

3.8
pip install pyinstaller

pipinst.png

pyinstaller exetest.py --onefile
pipinst2.png

err
pipinst3.png

D:\py_exe1>pyinstaller exetest.py --onefile
373 INFO: PyInstaller: 3.5
373 INFO: Python: 3.8.0
376 INFO: Platform: Windows-10-10.0.18362-SP0
379 INFO: wrote D:\py_exe1\exetest.spec
382 INFO: UPX is not available.
420 INFO: Extending PYTHONPATH with paths
['D:\\py_exe1', 'D:\\py_exe1']
421 INFO: checking Analysis
424 INFO: Building Analysis because Analysis-00.toc is non existent
426 INFO: Initializing module dependency graph...
436 INFO: Initializing module graph hooks...
447 INFO: Analyzing base_library.zip ...
15251 INFO: running Analysis Analysis-00.toc
15328 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\users\hg450g2-320\appdata\local\programs\python\python38-32\python.exe
16621 INFO: Caching module hooks...
16633 INFO: Analyzing D:\py_exe1\exetest.py
16641 INFO: Loading module hooks...
16641 INFO: Loading module hook "hook-encodings.py"...
16878 INFO: Loading module hook "hook-pydoc.py"...
16881 INFO: Loading module hook "hook-xml.py"...
17801 INFO: Looking for ctypes DLLs
17809 INFO: Analyzing run-time hooks ...
17815 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
17836 INFO: Looking for dynamic libraries
20480 INFO: Looking for eggs
20480 INFO: Using Python library c:\users\hg450g2-320\appdata\local\programs\python\python38-32\python38.dll
20481 INFO: Found binding redirects:
[]
20511 INFO: Warnings written to D:\py_exe1\build\exetest\warn-exetest.txt
20633 INFO: Graph cross-reference written to D:\py_exe1\build\exetest\xref-exetest.html
20692 INFO: checking PYZ
20693 INFO: Building PYZ because PYZ-00.toc is non existent
20694 INFO: Building PYZ (ZlibArchive) D:\py_exe1\build\exetest\PYZ-00.pyz
Traceback (most recent call last):
  File "c:\users\hg450g2-320\appdata\local\programs\python\python38-32\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\hg450g2-320\appdata\local\programs\python\python38-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\hg450g2-320\AppData\Local\Programs\Python\Python38-32\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "c:\users\hg450g2-320\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\__main__.py", line 111, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\users\hg450g2-320\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\users\hg450g2-320\appdata\local\programs\python\python38-32\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\hg450g2-320\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\build_main.py", line 791, in build
    exec(code, spec_namespace)
  File "D:\py_exe1\exetest.spec", line 18, in <module>
    pyz = PYZ(a.pure, a.zipped_data,
  File "c:\users\hg450g2-320\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\api.py", line 98, in __init__
    self.__postinit__()
  File "c:\users\hg450g2-320\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
    self.assemble()
  File "c:\users\hg450g2-320\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\api.py", line 128, in assemble
    self.code_dict = {
  File "c:\users\hg450g2-320\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\api.py", line 129, in <dictcomp>
    key: strip_paths_in_code(code)
  File "c:\users\hg450g2-320\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\utils.py", line 652, in strip_paths_in_code
    consts = tuple(
  File "c:\users\hg450g2-320\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\utils.py", line 653, in <genexpr>
    strip_paths_in_code(const_co, new_filename)
  File "c:\users\hg450g2-320\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\utils.py", line 652, in strip_paths_in_code
    consts = tuple(
  File "c:\users\hg450g2-320\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\utils.py", line 653, in <genexpr>
    strip_paths_in_code(const_co, new_filename)
  File "c:\users\hg450g2-320\appdata\local\programs\python\python38-32\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)



参考
Pythonコードをexe化



posted by a23 at 18:52| Comment(0) | Python
この記事へのコメント
コメントを書く
お名前: [必須入力]

メールアドレス: [必須入力]

ホームページアドレス: [必須入力]

コメント: [必須入力]

認証コード: [必須入力]


※画像の中の文字を半角で入力してください。