【发布时间】:2019-12-20 19:14:51
【问题描述】:
我一直在 OSX 上使用 SublimeText 没有问题...直到我尝试导入 pygame。几行简单的代码,如:
print("Hello")
import sys
import pygame
得到以下输出:
Hello
Traceback (most recent call last):
File "/Users/andrewjmiller/Desktop/python_work/new_file.py", line 5, in <module>
import pygame
ImportError: No module named pygame
[Finished in 0.0s with exit code 1]
[shell_cmd: python -u "/Users/andrewjmiller/Desktop/python_work/new_file.py"]
[dir: /Users/andrewjmiller/Desktop/python_work]
[path: /Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Users/andrewjmiller/anaconda3/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]
但是...我确实安装了 pygame,如下所示:
iMac:~ AndyTheAdmin$ python3 -m pip install --user pygame==2.0.0.dev6
Requirement already satisfied: pygame==2.0.0.dev6 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (2.0.0.dev6)
我已经卸载并重新安装了 SublimeText3。接下来我应该尝试什么?
【问题讨论】:
标签: python-3.x pygame sublimetext3