You can simply follow these steps:

  1. In the Settings/Preferences dialog (Ctrl+Alt+S), click Editor | General | Auto Import.
  2. In the Python section, configure automatic imports:
    • Select Show import popup to automatically display an import popup when tying the name of a class that lacks an import statement.
    • Select one of the Preferred import style options to define the way an import statement to be generated.

Let me know how it goes!

Answer from Aly Mobarak on Stack Overflow
๐ŸŒ
JetBrains
jetbrains.com โ€บ help โ€บ pycharm โ€บ creating-and-optimizing-imports.html
Auto import | PyCharm Documentation
1 month ago - Using Import Assistant is the preferred way to handle imports in PyCharm because import optimizations are not supported via command line. The same possibility applies to XML files. When you type a tag with an unbound namespace, the import assistant suggests creating a namespace and offers a list of appropriate choices. You can configure the IDE to automatically add import statements if there are no options to choose from.
Discussions

python - Can I use another shortcut for auto import in pycharm? - Stack Overflow
The shortcut Alt+Enter is intercepted by my window manager(i3) to create a new terminal, so the default shortcut of auto import(which is also Alt + Enter) doesn't work in pycharm. Can I use another More on stackoverflow.com
๐ŸŒ stackoverflow.com
python - Pycharm auto relative imports - Stack Overflow
Whenever you use autoimport provided by PyCharm it generates an absolute path import. i.e. from my_package.my_subpackage import my_thing instead of from .my_subpackage import my_thing Is there a More on stackoverflow.com
๐ŸŒ stackoverflow.com
Why my auto import doesn't work like in pycharm?
Just in case -> settings.json { "workbench.colorTheme": "Monokai", "workbench.iconTheme": "material-icon-theme", "window.zoomLevel": 1, "python.analysis.completeFunctionParens": true, "python.analysis.indexing": true, "python.analysis.autoImportCompletions": true, "python.analysis.diagnosticMode": "workspace", } More on reddit.com
๐ŸŒ r/vscode
6
3
August 22, 2022
python 3.x - Pycharm auto-import is not working with variables inside f-strings - Stack Overflow
It seems like the auto import functionality of Pycharm doesn't work on f-strings. Does anybody has experienced the same behaviour ? Does a solution exist to fix this ? What I mean is this: Let's s... More on stackoverflow.com
๐ŸŒ stackoverflow.com
November 8, 2019
๐ŸŒ
Reddit
reddit.com โ€บ r/jetbrains โ€บ intelij auto import functionality in pycharm
r/Jetbrains on Reddit: InteliJ Auto Import Functionality In PyCharm
December 18, 2020 -

Hey All,

I recently started using InteliJ and I noticed as you start typing a class name it shows suggestions and you can tap enter to complete/import. Where as in PyCharm I typically have to type the class name and hit Alt Enter to import.

I feel like I'm missing an obvious setting but I can't seem to find it. Can anyone point me in the right direction?

https://imgur.com/a/wkjW8TD

๐ŸŒ
JetBrains
youtrack.jetbrains.com โ€บ issue โ€บ PY-31207 โ€บ Pycharm-Auto-Import-does-not-work-in-console
Pycharm: Auto-Import does not work in console : PY-31207
{{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
๐ŸŒ
JetBrains
youtrack.jetbrains.com โ€บ issue โ€บ PY-44845 โ€บ auto-import-stopped-working
auto import stopped working : PY-44845
{{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
๐ŸŒ
Medium
medium.com โ€บ the-lazy-developer โ€บ lazy-developer-tip-3-auto-import-python-modules-a66a314b22b
Automatically import Python modules in PyCharm as you code | by Devin Finzer | The Lazy Developer | Medium
May 12, 2016 - PyCharm auto-imports in action. Auto-imports allow you to autocomplete whatever code youโ€™re typing with a list of modules, classes, or functions which are immediately auto-imported when selected. ... 3. Next, look up the keyboard shortcut for auto-completion and change it to whatever shortcut youโ€™d like to use. ... Now when you tap this shortcut twice you will get the special auto-import dropdown (Iโ€™d love to know a way to get this to work ...
Find elsewhere
๐ŸŒ
JetBrains
youtrack.jetbrains.com โ€บ issue โ€บ PY-44845
Jetbrains
November 19, 2021 - {{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
๐ŸŒ
JetBrains
youtrack.jetbrains.com โ€บ issue โ€บ PY-14206 โ€บ Auto-import-does-not-include-Source-root
Auto-import does not include Source root : PY-14206
{{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ why my auto import doesn't work like in pycharm?
r/vscode on Reddit: Why my auto import doesn't work like in pycharm?
August 22, 2022 - I have a high threshold for tolerating bugs with Jetbrains/Pycharm, but.... damn it's getting old. ... Anything and everything relating to JetBrains their products and projects. Find out more about JetBrains at https://jetbrains.com/ ... Hi, in the past 3 months, I found decreasing quality of IDE hints. WebStorm is showing incorrect hints despite type awareness from the typescript server. Issue persists in a fresh install. VS Code works correctly.
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 58769844 โ€บ pycharm-auto-import-is-not-working-with-variables-inside-f-strings
python 3.x - Pycharm auto-import is not working with variables inside f-strings - Stack Overflow
November 8, 2019 - It seems like the auto import functionality of Pycharm doesn't work on f-strings. Does anybody has experienced the same behaviour ? Does a solution exist to fix this ? What I mean is this: Let's say we have a constant in a moduleA, and that in moduleB, we do something like: ... I would expect Pycharm to prompt for auto-importing A_CONSTANT_IN_MODULEA, but it doesn't. I am using Pycharm Community edition version 2019.2 on OpenSUSE ... I'm not sure what's different about my PyCharm, but I've never once been prompted to auto-import a module.
๐ŸŒ
JetBrains
intellij-support.jetbrains.com โ€บ hc โ€บ en-us โ€บ community โ€บ posts โ€บ 360004264019-Pycharm-doesn-t-detect-suggest-modules-classes-or-functions-to-import-when-typing
Pycharm doesn't detect / suggest modules, classes, or functions to import when typing โ€“ IDEs Support (IntelliJ Platform) | JetBrains
June 29, 2019 - Expected behavior: a context menu will automatically open with "Import from..." in the title, offering to import "os.path.join()" Actual behavior: Nothing happens. Once "join" is fully typed out, alt+enter will display an option to import the function ... I don't think PyCharm ever offered imports from incomplete entries like "joi".
๐ŸŒ
JetBrains
intellij-support.jetbrains.com โ€บ hc โ€บ en-us โ€บ community โ€บ posts โ€บ 360003378240-python-console-and-auto-import-not-working-for-my-project-s-code
python console and auto import not working for my project's code โ€“ IDEs Support (IntelliJ Platform) | JetBrains
March 24, 2019 - I can get the discovery of the class I want to use, but the `from myModule import MyClass` is not automatically added. If I try to do that for an external package, it works fine. For example if I want to import something included in the django package it's ok, but anything in my project is found in the suggestion, but the import line is not added.
๐ŸŒ
JetBrains
jetbrains.com โ€บ help โ€บ pycharm โ€บ auto-completing-code.html
Code completion | PyCharm Documentation
February 2, 2026 - Auto-import on code completion is also applied to some popular package name aliases, such as np for numpy or pd for pandas. PyCharm allows you to prioritize completion suggestions based on choices that other users made in similar situations. The ML completion mechanism does not add any new ...
๐ŸŒ
Quora
quora.com โ€บ Why-is-import-not-working-in-PyCharm
Why is import not working in PyCharm? - Quora
... It means you are importing some stuffs, but not using them. You should first take it as a warning and check your code to see why are you importing it at all. Likely, your code will work as you desire without that specific import statement.