Skip to content Skip to sidebar Skip to footer

How To Get Pycharm Ide To Do Code Completion For Pygame's Sub-modules?

Intro: pygame is a python module used to create games. I've properly installed the module and my PyCharm successfully imports it. I'll jump straight to an example scenario: Trying

Solution 1:

Here is how you can fix this issue specifically for pygame:

  1. Go to your pygame folder and open __init__.py in a text editor
  2. Navigate to the import section with the try/except clauses (around line 109)
  3. Change the format from import pygame.module to from pygame import module for the modules you want

For example, change

try: import pygame.event

to

try: from pygame import event

Restart PyCharm and it should work :)

Solution 2:

JetBrains is a generic IDE. The same auto-complete feature for IntelliJ is the same auto-complete they use for PyCharm and all their other environments. Thus auto-completions are derived from your existing code, not from the language's modules. See here for more.

Post a Comment for "How To Get Pycharm Ide To Do Code Completion For Pygame's Sub-modules?"