Как подключить pygame к pycharm

Add pygame module in PyCharm IDE

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?

Как подключить pygame к pycharm. Смотреть фото Как подключить pygame к pycharm. Смотреть картинку Как подключить pygame к pycharm. Картинка про Как подключить pygame к pycharm. Фото Как подключить pygame к pycharm

Как подключить pygame к pycharm. Смотреть фото Как подключить pygame к pycharm. Смотреть картинку Как подключить pygame к pycharm. Картинка про Как подключить pygame к pycharm. Фото Как подключить pygame к pycharm

5 Answers 5

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:

Download the appropriate interpreter with PyGame included

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

Press Settings (Or Ctrl + Alt + S)

Double click on the option that looks like Project: Name_of_Project

Click on Project Interpreter

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)

I hope this helps you!

Как подключить pygame к pycharm. Смотреть фото Как подключить pygame к pycharm. Смотреть картинку Как подключить pygame к pycharm. Картинка про Как подключить pygame к pycharm. Фото Как подключить pygame к pycharm

For PyCharm 2017 do the following:

Not I’m saying that the answers above won’t work, but it might be frustrating to a newbie to do command line magic.

If you are using PyCharm and you are on a Windows 10 machine use the following instructions:

Click on the Windows start menu and type cmd and click on the Command Prompt icon.

Use the command pushd to navigate to your PyCharm project which should be located in your user folder on the C:\ drive. Example: C:\Users\username\PycharmProjects\project name\venv\Scripts.

(If you are unsure go to the settings within PyCharm and navigate to the Python Interpreter settings. This should show you the file path for the interpreter that your project is using. Credit to Anthony Pham for instructions to navigate to interpreter settings.)

HINT: Use copy and paste in the command prompt to paste in the file path.

Use the command pip install pygame and the pip program will handle the rest for you.

Restart you Pycharm and you should now be able to import pygame

Hope this helps. I had a fun time trying to find out the correct way to get it installed, so hopefully this helps someone out in the future.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *