简体   繁体   English

没有名为“pygame.base”的模块

[英]No module named 'pygame.base'

I've been having a lot of trouble converting one of my python projects into an executable with the use of pyinstaller.使用 pyinstaller 将我的 python 项目之一转换为可执行文件时,我遇到了很多麻烦。 Upon launching the.exe, it gives this rather simple error that I just can't get my head around.启动 .exe 后,它给出了这个相当简单的错误,我无法理解。 The script works as intended in the editor (pycharm in this case).该脚本在编辑器中按预期工作(在本例中为 pycharm)。

In pyinstaller there is a single warning message displayed, "Hidden import "pygame._view" not found!"在 pyinstaller 中显示一条警告消息,“未找到隐藏导入“pygame._view”!”

I've tried using 32 and 64 bit versions of pygame, reinstalled several times and purged pip cache history.我尝试使用 32 位和 64 位版本的 pygame,重新安装了几次并清除了 pip 缓存历史记录。

I'm aware images aren't liked around here, but the.exe only remains open for one frame, I simply don't have enough time to copy the actual text.我知道这里不喜欢图像,但.exe 只保持打开一帧,我根本没有足够的时间来复制实际文本。 Full error message完整的错误信息

If the code works fine in pycharm, then it might just be an issue with importing the module in the script.如果代码在 pycharm 中运行良好,那么在脚本中导入模块可能只是一个问题。 At least that's what the error emssage seems to be saying.至少这就是错误消息似乎在说的。 Do you specifically import pygame.base or the like in the __init__.py script? __init__.py脚本中是否专门导入pygame.base之类的?

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

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