Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pycharm builtin unresolved reference

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?

like image 990
djdick Avatar asked Dec 02 '13 15:12

djdick


People also ask

Why import is not working in PyCharm?

Troubleshooting: Try installing/importing a package from the system terminal (outside of PyCharm) using the same interpreter/environment. In case you are using a virtualenv/conda environment as your Project Interpreter in PyCharm, it is enough to activate that environment in the system terminal and then do the test.


2 Answers

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?

like image 140
ecatmur Avatar answered Sep 19 '22 11:09

ecatmur


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.

like image 21
Dan Passaro Avatar answered Sep 19 '22 11:09

Dan Passaro