PyCharm 未解决的参考“打印" [英] PyCharm Unresolved reference 'print'
问题描述
我开始学习python语言,并决定试用PyCharm IDE,它看起来非常不错.但是,每当我写 print 时,它都会说未解析的参考'打印'".我可以运行程序,但是这个红色下划线真的很烦人.我该如何解决这个问题?
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?
推荐答案
我遇到了和你一样的问题,尽管我将 Python 3.4.0 配置为项目的解释器和所有 print
的解释器代码中包含符合 Python 3 的函数调用.
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.
我通过在 PyCharm 中执行此操作解决了它:
I got it sorted out by doing this in PyCharm:
文件 -> 使缓存无效/重新启动... -> 无效并重新启动
File -> Invalidate Caches / Restart... -> Invalidate and Restart
这篇关于PyCharm 未解决的参考“打印"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!