pygame not working with portable python

房东的猫 提交于 2020-01-11 10:21:51

问题


I'm trying to get pygame working with portable python 3.2.1.1 running off a USB stick, but when I use the following code:

import pygame, sys

It says:

ImportError: No module named pygame

My understanding was that pygame came embedded in portable python. Can anyone help?


回答1:


Pygame does not come embeded in portable python 3.2. Tho it comes in the 2.7 version.

Sources: http://portablepython.com/wiki/PortablePython3.2.1.1 - 3.2 (No pygame here!) http://portablepython.com/wiki/PortablePython2.7.3.1 - 2.7 (Pygame embeded!)




回答2:


Running Pygame on Portable Python....

On Windows 7 download and copy the msi file into your portable directory. Double-click the msi file. When prompted for the directory, change to the USB drive. Once done, copy the library and site packages contents to the USB library and site packages.

To test, bring up Python interpreter, then type "import pygame".

If successful, you will not receive an error when importing.



来源:https://stackoverflow.com/questions/13119671/pygame-not-working-with-portable-python

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