1

我已经在我的 Windows 7 操作系统的文件夹 C:\Python34\Lib\site-packages\Include (Python 3.4) 中安装了带有文件 pygame-1.9.2a0.win32-py3.4.msi 的 Pygame。当我尝试使用import pygame它导入它时,会显示以下错误消息:

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

当我使用 LiClipse 并将文件夹 C:\Python34\Lib\site-packages\Include 包含在外部库下的 pythonpath 中时,import pygame不再有错误消息,但是当我使用时,pygame.init()我收到以下错误消息

pygame.init()
AttributeError: 'module' object has no attribute 'init'

我是否将它安装到正确的文件夹中,是否在 LiClipse 中设置了正确的文件夹(或者我是否应该首先设置一个文件夹),我该怎么做才能让它工作?

4

1 回答 1

0

你试过做点安装吗?此链接可能会解释您需要做什么。

如何在 Python 3.4 上安装 PyGame?

于 2015-12-02T16:25:14.030 回答