且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2022-06-23 05:29:04

一种方法是使用Python 3.4. 另一个解决方案是转到您的Python目录(在我的情况下为C:\Program Files\Python35),然后转到Lib目录,然后转到site-packages目录(如果您使用pip安装了Py2Exe).然后,将run-py3.4-win32.exe文件复制到另一个目录.将文件重命名为run-py3.5-win32.exe.将其复制回py2exe目录.对run_ctypes_dll-py3.4-win32.dll执行相同的操作,但将其重命名为run_ctypes_dll-py3.5-win32.它适用于大多数程序.

One method is to use 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). Then, copy the run-py3.4-win32.exe file to another directory. Rename the file to run-py3.5-win32.exe. Copy that back to the py2exe directory. Do the same with the run_ctypes_dll-py3.4-win32.dll, but rename it to run_ctypes_dll-py3.5-win32. It should work for most programs.

如果这不起作用,请安装python 3.4,然后输入py -3.4 setup_py2exe.py py2exe

If that doesn't work, install python 3.4, and run your setup script by typing py -3.4 setup_py2exe.py py2exe