Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij python no recoginiize lib

I use intellij with python plugin. when I want to import python libs like import random I got editor error. No module named random less... (Ctrl+F1) This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items.

when I run the code every thing is ok what can I do to make the intelij recognize this libs?

like image 972
user2999009 Avatar asked Sep 17 '26 12:09

user2999009


1 Answers

You may have fixed this by now, but I was having the same problem and finally solved it, so I figured I'd post the solution for anyone who came here by Googling/Binging the error message:

I went to File > Project Structure > Modules, highlighted the main module, then pressed the plus sign and then "Python" under "Framework".

Hope that helps you or someone else.

like image 166
bdhr Avatar answered Sep 20 '26 00:09

bdhr