3

Whenever I try to use a search cursor from arcpy in pycharm, I get this unresolved reference error. I should note that it was working fine earlier in the night, I have no idea what happened.

Screenshot of issue

I've tried everything in this Q&A already:

https://stackoverflow.com/questions/11725519/pycharm-shows-unresolved-references-error-for-valid-code

Other arcpy functions seem to work fine. I've also tried restarting computer and reinstalling pycharm. I can use the search cursor when I use IDLE.

franchyze923
  • 493
  • 6
  • 15
  • Does this stop your scripts from running, or is it just the IDE telling you it can't find it for the auto-complete? My Visual Studio 2013 also doesn't find SearchCursor etc. but I'm still able to complete the code and everything runs fine. – Midavalo Jun 16 '16 at 07:53
  • Have you looked at http://gis.stackexchange.com/questions/14713/how-to-setup-pycharm-to-reference-arcpy?rq=1 – Midavalo Jun 16 '16 at 07:55
  • Yes, it does work despite the message. I didn't even think to try it. Thanks! – franchyze923 Jun 16 '16 at 16:22
  • 1
    To get rid of the message you can add a comment line to ignore the inspection:
            # noinspection PyUnresolvedReferences
    
            mycursor = arcpy.da.SearchCursor(table, fields, where_clause)
    
    – Koen Oct 23 '18 at 12:28
  • 1
    This question is NOT a duplicate of 'Setting up PyCharm to reference ArcPy?'. arcpy.da classes are not visible in PyCharm or other IDE by default even arcpy is referenced. Please see https://gis.stackexchange.com/questions/120335/why-does-arcpy-da-searchcursor-class-not-autocomplete-within-eclipse/120517 to get idea what it is about and how to sort out this issue in Eclipse IDE. Vote to reopen this question! – Miro Feb 20 '19 at 06:19

0 Answers0