pygame init
报错:AttributeError: module 'pygame' has no attribute 'init'代码:
import pygame
#导入pygame库
pygame.init() 本帖最后由 Twilight6 于 2020-5-18 11:32 编辑
建议卸载模块重装试试
卸载:
pip uninstall pygame
安装:
python -m pip install pygame -i https://pypi.tuna.tsinghua.edu.cn/simple
Twilight6 发表于 2020-5-18 11:24
建议卸载模块重装试试
卸载:
你确定卸载是你那样卸载的? 还有一种可能就是你代码同目录下,有个自己写的代码,而且文件名正好是pygame.py
不建议你用模块名当作自己写代码时候的命名,不然会导入自己写的代码 qiuyouzhi 发表于 2020-5-18 11:31
你确定卸载是你那样卸载的?
emmm,谢谢指出 少打了un
页:
[1]