[英]How to disable errorr message 'print keyword can't be used as identifier in python 2' in pycharm?
I am using PyCharm 2018.3.4 (Professional Edition) and I keep getting this error messsage even on simple statements such as 我正在使用PyCharm 2018.3.4(Professional Edition),即使在诸如
print(matching_bids)
or 要么
print("packed",str(packed))
I know this is more of a suggestion, but the only 3 top results in Google talk about this problem, and there is an unanswered question about this in the jetbrains forum . 我知道这更多是一个建议,但是Google仅有的3个顶级结果谈到了这个问题,而jetbrains论坛中对此没有一个未解决的问题 。 Hence, I have no idea what to do about this error, because it cannot be a syntax error.
因此,我不知道该怎么办,因为它不能是语法错误。 I am not able to disable it from the inspections either, and cannot disable 'All Inspections' just for this and write more erroneous code without pertinent warnings.
我也不能从检查中禁用它,也不能为此禁用“所有检查”,并且在没有相关警告的情况下编写更多错误代码。
Even if I create a new .py file and just enter 即使我创建一个新的.py文件并输入
print("hi")
it still shows this error. 它仍然显示此错误。
I am using 3.7 python with a django ver 2.0.1 我正在将3.7 python与Django ver 2.0.1一起使用
Update: This is my project interpreter: 更新:这是我的项目解释器:
As pointed out by @rdas in comments. 正如@rdas在评论中指出的那样。 Please make sure you have set Python 3 as your project interpreter.
请确保已将Python 3设置为项目解释器。
Reference : https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html 参考: https : //www.jetbrains.com/help/pycharm/configuring-python-interpreter.html
Based on the update of your post, to just disable the error do this: 根据您帖子的更新,要仅禁用错误,请执行以下操作:
Go To File > Settings > Editor > Inspections 转到文件>设置>编辑器>检查
Search for "identifier" 搜索“标识符”
Disable "Correctness of identifier reference" 禁用“标识符引用的正确性”
I do not recommend this but if you see no other way to solve this issue this is a temporary fix. 我不建议这样做,但是,如果您没有其他方法可以解决此问题,则这是暂时的解决方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.