Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm Unresolved reference 'print' [closed]

Tags:

python

pycharm

I started to learn python language, and decided to try out PyCharm IDE, which looks really nice. But, whenever I write print it says "Unresolved reference 'print'". I can run the program, but this red-underline is really annoying. How can I fix this?

like image 325
user3385945 Avatar asked Mar 29 '14 23:03

user3385945


2 Answers

I have had the same problem as you, even though I configured Python 3.4.0 as the project's interpreter and all print's in the code were Python 3 compliant function calls.

I got it sorted out by doing this in PyCharm:

File -> Invalidate Caches / Restart... -> Invalidate and Restart

like image 118
Daniel K Avatar answered Sep 19 '22 12:09

Daniel K


If you're in PyCharm and you're getting "Unresolved reference xrange" it's because xrange was removed in Python 3. Range takes over its functionality now. Was working on fast string concat from here:

https://waymoot.org/home/python_string/

And credit for the answer is from /r/learnpython:

https://www.reddit.com/r/learnpython/comments/2udj3s/pycharm_issue/

like image 28
fIwJlxSzApHEZIl Avatar answered Sep 18 '22 12:09

fIwJlxSzApHEZIl