在 PyCharm IDE 中添加 pygame 模块 [英] Add pygame module in PyCharm IDE

查看:72
本文介绍了在 PyCharm IDE 中添加 pygame 模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从 Pygame 网站下载了 pygame-1.9.1release.tar.gz.我提取并安装了它,它在终端(Ubuntu)的命令行 Python 解释器中运行良好.但我想为一些 IDE 安装它,比如 PyCharm.我该怎么做?

I've downloaded pygame-1.9.1release.tar.gz from the Pygame website. I extracted and installed it and it's working fine in the command line Python interpreter in Terminal (Ubuntu). But I want to install it for some IDE, like PyCharm. How can I do it?

推荐答案

好吧,您不必在此处为 PyCharm 下载它.您可能知道它如何检查您的代码.通过翻译!您不需要使用复杂的命令行或类似的东西.你需要的是:

Well, you don't have to download it for PyCharm here. You probably know how it checks your code. Through the interpreter! You don't need to use complex command lines or anything like that. You need to is:

  • 下载合适的解释器包含 PyGame

打开你的 PyCharm IDE(确保它是最新的)

Open your PyCharm IDE (Make sure it is up to date)

转到文件

Settings(或 Ctrl + Alt + S)

Press Settings (Or Ctrl + Alt + S)

双击看起来像Project:Name_of_Project

点击Project Interpreter

选择您要使用的解释器,包含 PyGame 作为模块

Choose the interpreter you want to use that includes PyGame as a module

保存您的选项

你准备好了!这是一个替代方案(我从未这样做过,请尝试测试)

And you are ready to go! Here is an alternate (I have never done this, please try to test it)

  • 将 PyGame 添加到与您的 PyCharm 文件相同的文件夹中(您的 PyCharm 内容始终在在安装/升级期间放置的特定文件)请考虑将您的 PyCharm 内容放在一个文件夹中以便于访问.
  • Add PyGame in the same folder as your PyCharm file (Your PyCharm stuff is always in a specific file placed by you during installation/upgrade) Please consider putting your PyCharm stuff inside a folder for easy access.

希望对你有帮助!

这篇关于在 PyCharm IDE 中添加 pygame 模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆