Py2exe error: [Errno 2] There is no such file or directory

C:\Users\Shalia\Desktop\accuadmin>python setup_py2exe.py py2exe
running py2exe

  10 missing Modules
  ------------------
? PIL._imagingagg                     imported from PIL.ImageDraw
? PyQt4                               imported from PIL.ImageQt
? PyQt5                               imported from PIL.ImageQt
? PySide                              imported from PIL.ImageQt
? _imaging_gif                        imported from PIL.GifImagePlugin
? _util                               imported from PIL.ImageCms
? cffi                                imported from PIL.Image, PIL.PyAccess
? enchant                             imported from guess_language
? readline                            imported from cmd, code, pdb
? tkinter                             imported from PIL.ImageTk, __SCRIPT__
Building 'dist\AccuAdmin.exe'.
error: [Errno 2] No such file or directory: 'C:\\Users\\Shalia\\AppData\\Local\\
Programs\\Python\\Python35-32\\lib\\site-packages\\py2exe\\run-py3.5-win32.exe'

So, I tried to be smart and went that route and renamed run-py3.4-win32.exe to run-py3.4-win32.exe, which worked, except that I was getting a separate error.

C:\Users\Shalia\Desktop\accuadmin>python setup_py2exe.py py2exe
running py2exe

  10 missing Modules
  ------------------
? PIL._imagingagg                     imported from PIL.ImageDraw
? PyQt4                               imported from PIL.ImageQt
? PyQt5                               imported from PIL.ImageQt
? PySide                              imported from PIL.ImageQt
? _imaging_gif                        imported from PIL.GifImagePlugin
? _util                               imported from PIL.ImageCms
? cffi                                imported from PIL.Image, PIL.PyAccess
? enchant                             imported from guess_language
? readline                            imported from cmd, code, pdb
? tkinter                             imported from PIL.ImageTk, __SCRIPT__
Building 'dist\AccuAdmin.exe'.
Building shared code archive 'dist\library.zip'.
Traceback (most recent call last):
  File "setup_py2exe.py", line 14, in <module>
    "optimize": 2,
  File "C:\Users\Shalia\AppData\Local\Programs\Python\Python35-32\lib\distutils\
core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\Shalia\AppData\Local\Programs\Python\Python35-32\lib\distutils\
dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\Users\Shalia\AppData\Local\Programs\Python\Python35-32\lib\distutils\
dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\Shalia\AppData\Local\Programs\Python\Python35-32\lib\site-packa
ges\py2exe\distutils_buildexe.py", line 188, in run
    self._run()
  File "C:\Users\Shalia\AppData\Local\Programs\Python\Python35-32\lib\site-packa
ges\py2exe\distutils_buildexe.py", line 268, in _run
    builder.build()
  File "C:\Users\Shalia\AppData\Local\Programs\Python\Python35-32\lib\site-packa
ges\py2exe\runtime.py", line 261, in build
    self.build_archive(libpath, delete_existing_resources=True)
  File "C:\Users\Shalia\AppData\Local\Programs\Python\Python35-32\lib\site-packa
ges\py2exe\runtime.py", line 426, in build_archive
    assert mod.__file__.endswith(EXTENSION_SUFFIXES[0])
AssertionError

Can anyone advise how to fix this? Py2exe should work for all versions of Python, so I'm not sure what will go wrong. I really don't want to remove Python3.5 for Python3.4. Thank.

+4
source share
1 answer

- Python 3.4. Python, C:\Program Files\Python35, Lib, site-packages ( Py2Exe pip). run-py3.4-win32.exe . run-py3.5-win32.exe. py2exe. run_ctypes_dll-py3.4-win32.dll, run_ctypes_dll-py3.5-win32. .

, python 3.4 script, py -3.4 setup_py2exe.py py2exe

+2

Source: https://habr.com/ru/post/1648031/


All Articles