简体   繁体   English

Py2exe错误:[Errno 2]没有这样的文件或目录

[英]Py2exe error: [Errno 2] 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 clever and went to that path and renamed run-py3.4-win32.exe to run-py3.4-win32.exe which worked except not I'm getting a separate error. 所以我试着变得聪明并且去了那条路径并将run-py3.4-win32.exe重命名为run-py3.4-win32.exe,除了没有得到单独的错误。

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's going wrong. Py2exe应该适用于所有版本的Python,所以我不确定出了什么问题。 I really don't want to have to uninstall Python3.5 for Python3.4. 我真的不想为Python3.4卸载Python3.5。 Thanks. 谢谢。

One method is to use Python 3.4. 一种方法是使用Python 3.4。 Another solution is to go to your Python Directory, in my case, C:\\Program Files\\Python35 , then go to the Lib directory, then go to the site-packages directory (if you installed Py2Exe with pip ). 另一个解决方案是转到你的Python目录,在我的例子中, C:\\Program Files\\Python35 ,然后转到Lib目录,然后转到site-packages目录(如果你用pip安装了Py2Exe)。 Then, copy the run-py3.4-win32.exe file to another directory. 然后,将run-py3.4-win32.exe文件复制到另一个目录。 Rename the file to run-py3.5-win32.exe . 将文件重命名为run-py3.5-win32.exe Copy that back to the py2exe directory. 将其复制回py2exe目录。 Do the same with the run_ctypes_dll-py3.4-win32.dll , but rename it to run_ctypes_dll-py3.5-win32 . run_ctypes_dll-py3.4-win32.dll执行相同run_ctypes_dll-py3.4-win32.dll ,但将其重命名为run_ctypes_dll-py3.5-win32 It should work for most programs. 它适用于大多数程序。

If that doesn't work, install python 3.4, and run your setup script by typing py -3.4 setup_py2exe.py py2exe 如果这不起作用,安装python 3.4,并通过键入py -3.4 setup_py2exe.py py2exe运行您的安装脚本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Py2exe [Errno 2] 没有这样的文件或目录:'m' - Py2exe [Errno 2] No such file or directory: 'm' Py2Exe,[Errno 2]没有这样的文件或目录:&#39;numpy-atlas.dll&#39; - Py2Exe, [Errno 2] No such file or directory: 'numpy-atlas.dll' Py2Exe没有这样的文件或目录错误 - Py2Exe No such File or Directory Error Py2exe创建exe时出错-目录 - Py2exe Error creating exe - Directory py2exe:错误:libzmq.pyd:没有这样的文件或目录 - py2exe: error: libzmq.pyd: No such file or directory 带有py2exe的ctypes的exe文件错误 - Error in exe file with ctypes with py2exe Py2exe和selenium - IOError:[Errno 2]没有这样的文件或目录:&#39;\\\\ dist \\\\ main.exe \\\\ selenium \\\\ webdriver \\\\ firefox \\\\ webdriver_prefs.json&#39; - Py2exe and selenium - IOError: [Errno 2] No such file or directory: '\\dist\\main.exe\\selenium\\webdriver\\firefox\\webdriver_prefs.json' Python 3.4的py2exe错误:Errno2,缺少文件&#39;run-py3 .4-win32.exe&#39; - py2exe error with Python 3.4: Errno2 , missing file 'run-py3 .4-win32.exe' py2exe出现“找不到文件”错误 - “File not found” error with py2exe 使用py2exe编译Python exe时出现“错误:libmmd.dll:没有这样的文件或目录” - “error: libmmd.dll: no such file or directory” when compiling a Python exe with py2exe
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM