PS C:ProjectsPythonApp> 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:ProjectsPythonAppwatermarkApp.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:ProjectsPythonAppbuildwatermarkAppPYZ-00.pyz Traceback (most recent call last): File "c:program filespython38librunpy.py", line 192, in _run_module_as_main return _run_code(code, main_globals, None, File "c:program filespython38librunpy.py", line 85, in _run_code exec(code, run_globals) File "C:Program FilesPython38Scriptspyinstaller.exe__main__.py", line 7, in <module> File "c:program filespython38libsite-packagesPyInstaller__main__.py", line 111, in run run_build(pyi_config, spec_file, **vars(args)) File "c:program filespython38libsite-packagesPyInstaller__main__.py", line 63, in run_build PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs) File "c:program filespython38libsite-packagesPyInstallerbuildingbuild_main.py", line 844, in main build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build')) File "c:program filespython38libsite-packagesPyInstallerbuildingbuild_main.py", line 791, in build exec(code, spec_namespace) File "C:ProjectsPythonAppwatermarkApp.spec", line 18, in <module> pyz = PYZ(a.pure, a.zipped_data, File "c:program filespython38libsite-packagesPyInstallerbuildingapi.py", line 98, in __init__ self.__postinit__() File "c:program filespython38libsite-packagesPyInstallerbuildingdatastruct.py", line 158, in __postinit__ self.assemble() File "c:program filespython38libsite-packagesPyInstallerbuildingapi.py", line 128, in assemble self.code_dict = { File "c:program filespython38libsite-packagesPyInstallerbuildingapi.py", line 129, in <dictcomp> key: strip_paths_in_code(code) File "c:program filespython38libsite-packagesPyInstallerbuildingutils.py", line 652, in strip_paths_in_code consts = tuple( File "c:program filespython38libsite-packagesPyInstallerbuildingutils.py", line 653, in <genexpr> strip_paths_in_code(const_co, new_filename) File "c:program filespython38libsite-packagesPyInstallerbuildingutils.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:ProjectsPythonApp>
파이썬으로 폴더안 이미지들에게 워터마크 박는걸 만들었는데 매번 비주얼코드로 실행하기 귀찮아서…exe 파일로 만들어보기로 했는데 pyinstaller가 계속 에러남
그래서 검색해보니 파이썬 3.8 버전에 뭐 문제 있는거 같음.(정확히는 3.8버전이랑 pyinstaller의 문제)
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz
이렇게 최신버전으로 받아서 설치후 다시 실행파일 만들기 하면 정상적으로 만들어진다.
근데 난 실행파일 하나 나오는 깔끔한 구조로 나올줄 알았는데 잡다한 파일이랑 폴더 생기는거 보니 그냥 bat 파일로 매번 컴파일 해서 쓰는게 나을듯.
답글 남기기