10

I'm using PyCharm and just trying out some simple stuff. When I try to use raw_input(), the editor is showing an unresolved reference error.

I'm not sure what the issue is. Has anyone seen this before?

MarianD
  • 13,096
  • 12
  • 42
  • 54
djdick
  • 189
  • 1
  • 2
  • 12
  • dmitry's response from this thread worked for me http://stackoverflow.com/questions/11725519/pycharm-shows-unresolved-references-error-for-valid-code – darKoram Dec 08 '14 at 15:47

3 Answers3

14

You have the language version set to Python 3; raw_input in Python 2 is just input in Python 3 (input in Python 2 is eval(input()) in Python 3: What's the difference between raw_input() and input() in python3.x?).

To select the Python version, see: How to select Python version in PyCharm?

Community
  • 1
  • 1
ecatmur
  • 152,476
  • 27
  • 293
  • 366
4

I was getting a similar issue. @property and ValueError were being shown as 'undefined'. I had mucked about with PyCharm's interpreter settings a bit beforehand, and I was able to fix it by using the File -> Invalidate Caches / Restart... and choosing the "Invalidate and Restart" command.

Dan Passaro
  • 4,211
  • 2
  • 29
  • 33
  • 1
    Getting this to work eludes me. I've watched the task that rebuilds the index run, and then subsequently reparse my source and mark all the built in as unknown. This is so frustrating, as I have been liking this IDE for cross platform use. – squeegee May 30 '14 at 22:42
0

In my case, I was getting the same error message when I tried :

variable = print("Some Text")

The problem is double quotes, single quotes will solve the problem as follows :

variable = print('Some text')
Gesy Darati
  • 113
  • 1
  • 6