简体   繁体   English

ImportError:没有使用pygame2exe命名_view的模块

[英]ImportError: No module named _view using pygame2exe

I am trying to distribute my game that was made using pygame. 我正在尝试分发使用pygame制作的游戏。

I have been through what seems like hundreds of stackoverflow questions and online forums on a wild goose chase to finally come to using pygame2exe and getting so close but getting an ImportError. 我已经经历了似乎数百个stackoverflow问题和在一个疯狂的追逐上的在线论坛,最终使用pygame2exe并得到如此接近但得到一个ImportError。

For the other people who have asked this question, they seemed to have added import pygame._view to the top of their main script. 对于其他提出此问题的人,他们似乎已将import pygame._view添加到其主脚本的顶部。 I have done this but to no avail has it worked :(. 我已经做到了这一点,但无济于事:(。

I would really like to solve my problem but I have no idea where to go from here. 我真的想解决我的问题,但我不知道从哪里开始。 Could anyone help me to fix this problem? 任何人都可以帮我解决这个问题吗?

-Thanks in advance, Landry. - 提前感谢,兰德里。

I suppose you have shadowed real pygame package with your own one. 我想你已经用你自己的pygame封装了真正的pygame包。 If yes - rename your package to avoid that ImportError . 如果是 - 重命名您的包以避免ImportError

See more info on The name shadowing trap article. 请参阅名称遮蔽陷阱文章的更多信息。

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

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