PyInstaller Can't create base_library.zip

邮差的信 提交于 2021-02-10 14:50:21

问题


I'm Newbie in python I usually use PyInstaller for convert file .py to .exe and it was work nomally this time i want to convert my .py file like before but it's have error 14037 ERROR: base_library.zip could not be created!

.........................................................

C:\Program Files\Python38>pyinstaller "HPFSERVER_with _mysql .py"
138 INFO: PyInstaller: 3.6
139 INFO: Python: 3.8.2
139 INFO: Platform: Windows-10-10.0.18362-SP0
142 INFO: wrote C:\Program Files\Python38\HPFSERVER_with _mysql .spec
144 INFO: UPX is not available.
148 INFO: Extending PYTHONPATH with paths
['C:\\Program Files\\Python38', 'C:\\Program Files\\Python38']
149 INFO: checking Analysis
149 INFO: Building Analysis because Analysis-00.toc is non existent
150 INFO: Initializing module dependency graph...
155 INFO: Caching module graph hooks...
202 INFO: Analyzing base_library.zip ...
6268 INFO: Processing pre-find module path hook   distutils
6431 INFO: distutils: retargeting to non-venv dir 'c:\\program files\\python38\\lib'
13892 INFO: Caching module dependency graph...
14037 ERROR: base_library.zip could not be created!
Traceback (most recent call last):
  File "c:\program files\python38\lib\runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\program files\python38\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\sattha\AppData\Roaming\Python\Python38\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "C:\Users\sattha\AppData\Roaming\Python\Python38\site-packages\PyInstaller\__main__.py", line 114, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "C:\Users\sattha\AppData\Roaming\Python\Python38\site-packages\PyInstaller\__main__.py", line 65, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "C:\Users\sattha\AppData\Roaming\Python\Python38\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\sattha\AppData\Roaming\Python\Python38\site-packages\PyInstaller\building\build_main.py", line 681, in build
    exec(code, spec_namespace)
  File "C:\Program Files\Python38\HPFSERVER_with _mysql .spec", line 6, in <module>
    a = Analysis(['HPFSERVER_with _mysql .py'],
  File "C:\Users\sattha\AppData\Roaming\Python\Python38\site-packages\PyInstaller\building\build_main.py", line 244, in __init__
    self.__postinit__()
  File "C:\Users\sattha\AppData\Roaming\Python\Python38\site-packages\PyInstaller\building\datastruct.py", line 160, in __postinit__
    self.assemble()
  File "C:\Users\sattha\AppData\Roaming\Python\Python38\site-packages\PyInstaller\building\build_main.py", line 352, in assemble
    create_py3_base_library(libzip_filename, graph=self.graph)
  File "C:\Users\sattha\AppData\Roaming\Python\Python38\site-packages\PyInstaller\depend\utils.py", line 68, in create_py3_base_library
    with zipfile.ZipFile(libzip_filename,mode = 'w') as zf:
  File "c:\program files\python38\lib\zipfile.py", line 1251, in __init__
    self.fp = io.open(file, filemode)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Program Files\\Python38\\build\\HPFSERVER_with _mysql \\base_library.zip'

.................................................................

Ps. my program have os , pymysql library inside if it would help Thanks a lot.


回答1:


Thanks to Mr.Legorooj I can convert .py to .exe now! How to fix this trouble 1.Just copy whole code in .py file 2.Create New .py file 3.Paste the code that you copy from old .py file in the new one. 4.use pyinstaller convert new file instead :D



来源:https://stackoverflow.com/questions/61691930/pyinstaller-cant-create-base-library-zip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!