简体   繁体   English

如何在原子编辑器上使用 Pygame?

[英]How can I use Pygame on atom editor?

I already installed the latest version of Python 3 and I installed Pygame using the terminal I also included import Pygame in my file however when I run the file it refuses to open and displays the error message " no module named pygame " What's the problem?我已经安装了最新版本的 Python 3 并且我使用终端安装了 Pygame 我还在我的文件中包含了 import Pygame 但是当我运行文件时它拒绝打开并显示错误消息“没有名为 pygame 的模块”有什么问题? What's the solution?解决办法是什么?

Try python3 first.py in your terminal.在终端中尝试python3 first.py

Or in your file first.py add this line at the top: (I used python3.x but you should add the correct version of your python 3)或者在你的文件 first.py 的顶部添加这一行:(我使用了 python3.x 但你应该添加正确版本的 python 3)

#!/usr/local/bin/python3.x

To see your version:要查看您的版本:

$ python3 -V
Python 3.5.2

To see your python 3 path:要查看您的 python 3 路径:

 $ which python3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM