安装了Pygame,但是python说没有模块pygame?

时间:2019-01-19 15:30:56

标签: python pygame

我已经尝试了2个多小时才能使pygame正常工作,并且已经阅读了pygame模块中的大约5个,但这里没有找到问题,没有解决方法

['C:/Users/USER\/AppData/Local/Programs/Python/Python37',
'C:\\Users\\USER\\\AppData\\Local\\Programs\\Python\\Python37\\Lib\\idlelib',
'C:\\Users\\USER\\\AppData\\Local\\Programs\\Python\\Python37\\python37.zip',
'C:\\Users\\USER\\\AppData\\Local\\Programs\\Python\\Python37\\DLLs',
'C:\\Users\\USER\\\AppData\\Local\\Programs\\Python\\Python37\\lib',
'C:\\Users\\USER\\\AppData\\Local\\Programs\\Python\\Python37',
'C:\\Users\\USER\\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages']

我的路径是python安装程序执行的吗?

当我检查是否安装了pygame时,我会得到

C:\Users\USER\\Downloads>python -m pip install -U pygame
Requirement already up-to-date: pygame in c:\users\USER\appdata\roaming\python\python37\site-packages (1.9.4)

当我在64位和32位的空闲状态下键入import pygame时,我会在下面收到此信息

Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
    import pygame
ModuleNotFoundError: No module named 'pygame'

如果之前已经发布了这个确切的问题,请指出答案,因为我阅读的书都没有帮助。

0 个答案:

没有答案