简体   繁体   English

问题:无法使用 pyinstaller、py2exe 将 .py 文件转换为 exe

[英]problem : cant convert .py file to exe , using pyinstaller, py2exe

8 version of python that include pip, pyinstaller, pygame, py2exe. 8个版本的python,包括pip、pyinstaller、pygame、py2exe。 I tried a lot of solutions, after a search in google and this website.在谷歌和这个网站上搜索后,我尝试了很多解决方案。 I tried to:我试过了:

  • convert my .py file to exe --> dont sucssed将我的 .py 文件转换为 exe --> 不成功
  • add the path to the enviorment variables --> dont work将路径添加到环境变量 --> 不起作用
  • install pyinstaller from the cmd, and then run the command pyinstaller --onefile -w "myfile.py" --> dont work, the same with work shell从cmd安装pyinstaller,然后运行命令pyinstaller --onefile -w "myfile.py" --> 不工作,与工作shell相同
  • install the py2exe from the cmd and then with to convert to exe --> don't work从 cmd 安装 py2exe 然后用 转换为 exe --> 不工作
  • reinstall --> dont work重新安装 --> 不起作用

Everything tells me that the problem is my version(3.8) of python, because this version don't support yet on the pyinstaller(acording to what I read).一切都告诉我问题是我的python版本(3.8),因为这个版本在pyinstaller上尚不支持(根据我阅读的内容)。

cmd Error: cmd错误:

File C:\\Users\\zahta\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python38\\site-packages\\win32ctypes\\pywin32\\pywintypes.py", line 37, in pywin32error raise error(exception.winerror, exception.function, exception.strerror) win32ctypes.pywin32.pywintypes.error: (1920, 'LoadLibraryEx', 'The file cannot be accessed by the system')文件 C:\\Users\\zahta\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python38\\site-packages\\win32ctypes\\pywin32\\pywintypes.py”,第 37 行,在 pywin32error 中引发错误( exception.winerror, exception.function, exception.strerror) win32ctypes.pywin32.pywintypes.error: (1920, 'LoadLibraryEx', '系统无法访问该文件')

work shell Error:工作外壳错误:

File "C:\\Users\\zahta\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python38\\site-packages\\win32ctypes\\pywin32\\pywintypes.py", line 37, in pywin32error raise error(exception.winerror, exception.function, exception.strerror) win32ctypes.pywin32.pywintypes.error: (1920, 'LoadLibraryEx', 'The file cannot be accessed by the system')文件“C:\\Users\\zahta\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python38\\site-packages\\win32ctypes\\pywin32\\pywintypes.py”,第37行,在pywin32error中引发错误(exception.winerror, exception.function, exception.strerror) win32ctypes.pywin32.pywintypes.error: (1920, 'LoadLibraryEx', '系统无法访问该文件')

After typing the command in cmd nothing happened.在cmd中输入命令后什么也没发生。 After the WorkShell - dist folder created but empty without change my python version what can I do to fix it to get a excutable file of my game?在 WorkShell - dist 文件夹创建但没有更改我的 python 版本后,我可以做些什么来修复它以获得我的游戏的可执行文件?

Thank you谢谢

I'm also a beginner like you, but according to my research you are using python which is downloaded from windows store, which creates permission errors.我也是像你一样的初学者,但根据我的研究,你使用的是从 Windows 商店下载的 python,这会产生权限错误。 Try deleting windows store python and download it from the official python website.尝试删除 windows store python 并从官方 python 网站下载它。 Source: http://pyinstaller.47505.x6.nabble.com/1920-LoadLibraryExW-The-file-cannot-be-accessed-by-the-system-td2954.html来源: http : //pyinstaller.47505.x6.nabble.com/1920-LoadLibraryExW-The-file-cannot-be-accessed-by-the-system-td2954.html

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM