Configuring CLion python root directory for auto-imports

Viewed 19

My project has a directory structure like:

PROJECT_ROOT/
             src/
                 foo/
                     bar.py

I want my imports to look like:

from foo import bar

But IntelliJ's auto-import is writing:

from src.foo import bar

How do I tell IntelliJ that it should generate its imports relative to PROJECT_ROOT/src/ rather than relative to PROJECT_ROOT/?

0 Answers
Related