Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm shows unresolved references error for valid code

Tags:

python

pycharm

I am using PyCharm to work on a project. The project is opened and configured with an interpreter, and can run successfully. The remote interpreter paths are mapped properly. This seems to be the correct configuration, but PyCharm is highlighting my valid code with "unresolved reference" errors, even for built-in Python functions. Why don't these seem to be detected, even though the code runs? Is there any way to get PyCharm to recognize these correctly?


This specific instance of the problem is with a remote interpreter, but the problem appears on local interpreters as well.

like image 682
James McCalden Avatar asked Jul 30 '12 16:07

James McCalden


People also ask

How do I fix unresolved references?

If you still see the unresolved reference error after fixing the problem, try to build your Android application with Command + F9 for Mac or Control + F9 for Windows and Linux. The error should disappear after the build is completed.


2 Answers

File | Invalidate Caches... and restarting PyCharm helps.

like image 135
Dmitry Trofimov Avatar answered Sep 20 '22 17:09

Dmitry Trofimov


Dmitry's response didn't work for me.

I got mine working by going to Project Interpreters, Selecting the "Paths" tab, and hitting the refresh button in that submenu. It auto-populated with something called "python-skeletons".

edit: screenshot using PyCharm 3.4.1 (it's quite well hidden)

enter image description here

like image 44
kelorek Avatar answered Sep 17 '22 17:09

kelorek