pyinstaller 로 실행파일 만들때 에러나는 경우

PS C:\Projects\PythonApp> pyinstaller .\watermarkApp.py                                                                 67 INFO: PyInstaller: 3.5
67 INFO: Python: 3.8.0
67 INFO: Platform: Windows-10-10.0.18362-SP0
68 INFO: wrote C:\Projects\PythonApp\watermarkApp.spec
69 INFO: UPX is not available.
71 INFO: Extending PYTHONPATH with paths
['C:\\Projects\\PythonApp', 'C:\\Projects\\PythonApp']
71 INFO: checking Analysis
89 INFO: checking PYZ
89 INFO: Building PYZ because PYZ-00.toc is non existent
89 INFO: Building PYZ (ZlibArchive) C:\Projects\PythonApp\build\watermarkApp\PYZ-00.pyz
Traceback (most recent call last):
  File "c:\program files\python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\program files\python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python38\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "c:\program files\python38\lib\site-packages\PyInstaller\__main__.py", line 111, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\program files\python38\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\program files\python38\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:\program files\python38\lib\site-packages\PyInstaller\building\build_main.py", line 791, in build
    exec(code, spec_namespace)
  File "C:\Projects\PythonApp\watermarkApp.spec", line 18, in <module>
    pyz = PYZ(a.pure, a.zipped_data,
  File "c:\program files\python38\lib\site-packages\PyInstaller\building\api.py", line 98, in __init__
    self.__postinit__()
  File "c:\program files\python38\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
    self.assemble()
  File "c:\program files\python38\lib\site-packages\PyInstaller\building\api.py", line 128, in assemble
    self.code_dict = {
  File "c:\program files\python38\lib\site-packages\PyInstaller\building\api.py", line 129, in <dictcomp>
    key: strip_paths_in_code(code)
  File "c:\program files\python38\lib\site-packages\PyInstaller\building\utils.py", line 652, in strip_paths_in_code
    consts = tuple(
  File "c:\program files\python38\lib\site-packages\PyInstaller\building\utils.py", line 653, in <genexpr>
    strip_paths_in_code(const_co, new_filename)
  File "c:\program files\python38\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)
PS C:\Projects\PythonApp>  

파이썬으로 폴더안 이미지들에게 워터마크 박는걸 만들었는데 매번 비주얼코드로 실행하기 귀찮아서…exe 파일로 만들어보기로 했는데 pyinstaller가 계속 에러남

그래서 검색해보니 파이썬 3.8 버전에 뭐 문제 있는거 같음.(정확히는 3.8버전이랑 pyinstaller의 문제)

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

이렇게 최신버전으로 받아서 설치후 다시 실행파일 만들기 하면 정상적으로 만들어진다.
근데 난 실행파일 하나 나오는 깔끔한 구조로 나올줄 알았는데 잡다한 파일이랑 폴더 생기는거 보니 그냥 bat 파일로 매번 컴파일 해서 쓰는게 나을듯.

pyinstaller 결과

크리에이티브 커먼즈 라이선스Linsoo의 저작물인 이 저작물은(는)크리에이티브 커먼즈 저작자표시-동일조건변경허락 4.0 국제 라이선스에 따라 이용할 수 있습니다.

댓글 남기기

이메일은 공개되지 않습니다.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

This site uses Akismet to reduce spam. Learn how your comment data is processed.