Skip to main content

How to import Pygame in pycharm

hi, how are you today

Today we are going to discuss how to import pygame in pycharm. There are a simple step and that's it.

 import pygame  
or
 import pygame   as py (any name you can give of your choice in place of py)

So Above are the two methods to import pygame to pycharm.
After importing it will work and you can start designing your game.



What to do if pycharm is showing no module with name pygame is present





Method 1
  • You will get a red line under pygame where you have written import pygame.
  • Keep the cursor on that red line, and left click

  • press alt+enter and you will get an option of install package

  • click on that and all done and you can use it

If still it is not working then don't worry, we have one more way to install pygame package
first try the above steps and in 99.99% cases that will work, still issue follow below steps.

Method 2
  • click on file -> settings

  • see if the package name is present, if not then click on the plus icon on right top side

  •  a window of all available packages will appear, just type the package name in search tab
     

  • select the package and click on install and all done

So above are the two methods to install pygame package if pycharm is unable to recognize the package 


The above method you can use to any install package which shows module not present.

If still you are not able to to do this then please check  weather you have installed the module correctly using pip


Hope you all like this post and I wish this proves useful to you.
Keep sharing & give your views about post in comments.
Comments are always welcomed for better improvement.

Thanks :)
Please write comments if you find anything needs to be more clear, incorrect, or you want to share more information about the topic discussed above

Comments

Translate to your language

Popular posts from this blog

Different Stages of I2C communication

Different Stages Of I2C

Working demonstration of UART communication using 2 8051 uController on Proteus with Embedded C code.

Here we are going to use 2 at89c51 uControllers just to understand UART communication in 8051.