[英]Python can't find Pygame module on Mac
Using home-brew I have installed pygame as homebrew says this 使用home-brew我已经安装pygame,因为homebrew说
"Requirement already satisfied: pygame in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (1.9.1release)"
“已经满足要求:/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages(1.9.1release)中的pygame”
but when I run idle3 and import pygame, python says this 但是当我运行idle3并导入pygame时,python会这样说
">>> import pygame
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import pygame
ModuleNotFoundError: No module named 'pygame'"
When running Idle3, you are likely not invoking your Python 2.7 interpreter for which you've installed pygame
. 运行Idle3时,您可能不会调用已为其安装
pygame
Python 2.7解释器。
Does it work if you run python2.7
from the terminal and then import pygame
there? 如果您从终端运行
python2.7
然后在其中import pygame
,是否可以正常工作?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.