Cannot import DataFrame in PyCharm
File -> invalidate Caches\Restart (did not work)
Removed .idea file and opened project again (did not work)
Pointed project to new venv with all installed dependencies (did not work)

Finally, uninstalled PyCharm and installed again. It solved my problem.
I have installed pandas in my venv. The import statement from pandas import DataFrame is not recognized in Pycharm. DataFrame is underlined with red line. When I run the code, it works fine. Why DataFrame is not recognized.

Also suddenly, relative paths of local packages stopped working in PyCharm but code runs fine though.
Absolute path also works fine.


I have tried setting project as "source code"  in settings but does not solve the problem.