How can I get IntelliJ IDEA to recognize common Python modules? IntelliJ IDEA is complaining "unresolved reference" on everything despite that I have added my virtual environment as a "Python interpreter" and invalidated caches. These (1)(2) related questions did not help resolve the issue.
Import an existing module iml file from another project: From the main menu, select File | New | Module from Existing Sources. In the dialog that opens, specify the path the . iml file of the module that you want to import, and click Open.
The errors are caused by wrong source roots configuration. Your project doesn't know where to locate the reference.
Add a new content root From the main menu, select File | Project Structure⌘; and click Project Settings | Modules.
Select the necessary module and then open the Sources tab in the right-hand part of the dialog.
Click Add Content Root and specify the folder that you want to add as a new content root.
The link is here.
IntelliJ support discussed the same issue at here.
Another stack overflow discussion is here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With