简体   繁体   English

PyCharm 中的 Pygame

[英]Pygame In PyCharm

I can not import Pygame in pycharm.我无法在 pycharm 中导入 Pygame。 I've looked at videos and other posts.我看过视频和其他帖子。 I have it installed, both on the PyCharm interpreter and on my system.我在 PyCharm 解释器和我的系统上都安装了它。 I get an error that says no module named Pygame, module Pygame does not have an init attribute.我收到一条错误消息,指出没有名为 Pygame 的模块,模块 Pygame 没有 init 属性。

Go to File > Settings > Double Click on Project: (Your project name) > Project Interpreter > The + Button on the right side of the window.转到文件 > 设置 > 双击项目:(您的项目名称)> 项目解释器 > 窗口右侧的 + 按钮。 Also make sure you typed import pygame on the first line of the program.还要确保你在程序的第一行输入了import pygame

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

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