When i type import pygame, i get an error that reads:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import pygame
File "C:\Python27\lib\site-packages\pygame\__init__.py", line 95, in <module>
from pygame.base import *
ImportError: DLL load failed: The specified module could not be found.
>>>
Does anybody know what this means?
这意味着您需要查看 Dependency Walker 中的pygame\\base.pyd
并查看它找不到哪个 DLL。
I made this mistake too. The problem is that you are using the Idle Shell to attempt to build a Python program. Here is how I get out of the shell:
Now you can import your modules and begin programming:
import os, sys import pygame from pygame.locals import * [...]
This will give you the head start to work with pygame.
This question at Game Developement (another Stack Exchange Site) should answer your question: Installing the right version of PyGame
This user can't make Python to know that PyGame is there so he asks that question. His question should be similar to yours, making it convinient for you. I hope this helps you!
在命令提示符下,如果您使用的是 Windows PC,请编写pip install pygame
如果您使用的是 Linux 或 MacOS,请编写pip3 install pygame
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.