简体   繁体   中英

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?

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?

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.

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')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM