There are different configuration, depending on your needs I suggest you to go through this official JetBrains documentations about
To configure auto-import, in the Settings/Preferences dialog Ctrl+Alt+S
, go to Editor | General | Auto Import, and use the corresponding XML, Python, and TypeScript/JavaScript options.
To enable / change the short cut, do the following:
- Go to PyCharm -> Preferences
- Check “Show Import Popup”
- Next, look up the keyboard shortcut for auto-completion and change it to whatever shortcut you’d like to use.
When you tap this shortcut twice you will get the special auto-import dropdown
Or also
You can define your preferred import style for Python code by using the following options available on the Auto Import page of the project settings (Settings/Preferences | Editor | General | Auto Import).