PyCharm-unresolved reference issue

here are many solutions to this, some more convenient than others, and they don’t always work.

Here’s all you can try, going from ‘quick’ to ‘annoying’:

1、Do File -> Invalidate Caches / Restart and restart PyCharm.
You could also do this after any of the below methods, just to be sure.
2、Refresh the paths of your interpreter:
File -> Settings
Project: [name] -> Project Interpreter -> 'Project Interpreter': Gear icon -> More
Click the 'Show paths' button (bottom one)
Click the 'Refresh' button (bottom one)
3、Remove the interpreter and add it again:
File -> Settings
Project: [name] -> Project Interpreter -> 'Project Interpreter': Gear icon -> More
Click the 'Remove' button
Click the 'Add' button and re-add your interpeter
4、Delete your project preferences
Delete your project's .idea folder
Close and re-open PyCharm
Open your project from scratch
5、Delete your PyCharm user preferences (but back them up first).
~/.PyCharm50 on Mac
%homepath%/.PyCharm50 on Windows
6、Switch to another interpreter, then back again to the one you want.
7、Switch to another interpreter, don't switch back.

你可能感兴趣的:(Python)