Livewires + Pygame Error

风流意气都作罢 提交于 2019-12-25 02:11:09

问题


So I am running Windows 8 with python 3.3 installed. I have livewires and pygame installed.

But when I run the code:

from livewires import games

games.init(screen_width = 640, screen_height = 480, fps = 50)

games.screen.mainloop()

I get an error saying... ImportError: No module name 'pygame.image'.

Does anyone know how to fix this?


回答1:


Did you install pygame in the file directory of the python interpreter? But anyway pygame is not available for python 3.3 at the moment. If you want to use python 3 for coding, I would recommend 3.1.1 or 3.2, and use python 2.7.12 to compile them into an .exe file with pyinstaller, because pip is not compatible with 3.1.1 and 3.2. You can also write the code in python 2. I would recommend 2.7.12




回答2:


If you read the README.md file in the distro's module directory, you'll see that it was committed on September 25, 2013 and specifically states:

You will need Python to use the package. Python can be obtained from: http://www.python.org/download/. If you're installing for the first time, we recommend you use Python 2.2.3

I think it's quite likely that livewires will not work with Python 3.



来源:https://stackoverflow.com/questions/21418328/livewires-pygame-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!