python - 如何禁用错误消息 'print keyword can' t 用作 pycharm 中的 python 2' 中的标识符?

标签 python python-2.7 pycharm

我正在使用 PyCharm 2018.3.4(专业版),即使在简单的语句(例如

)上我也不断收到此错误消息
print(matching_bids)

print("packed",str(packed))

我知道这更多的是一个建议,但 Google 中仅有的 3 个顶级结果讨论了这个问题,并且有一个 unanswered question about this in the jetbrains forum 。因此,我不知道该怎么处理这个错误,因为它不可能是语法错误。我也无法从检查中禁用它,也无法为此禁用“所有检查”并在没有相关警告的情况下编写更多错误代码。

即使我创建一个新的 .py 文件并输入

print("hi")

它仍然显示此错误。

scshot

我正在使用 3.7 python 和 django 版本 2.0.1

更新: 这是我的项目解释器:

s

最佳答案

正如 @rdas 所指出的在评论中。请确保您已将 Python 3 设置为项目解释器。

引用:https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html

关于python - 如何禁用错误消息 'print keyword can' t 用作 pycharm 中的 python 2' 中的标识符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55951704/

相关文章:

Python特定的PATH环境变量?

python-2.7 - pygame 仅在鼠标在游戏窗口上处于事件状态时更新?

django - PyCharm Django 上一个项目的服务器在打开并运行另一个项目后仍然运行

python - Scrapy - 使用正则表达式选择 xpath

python - 无法通过 flask 邮件发送电子邮件

python - pycharm中的IdeaVim插件不支持长按连续滚动?

Python:展平 XML 文档(删除换行符)

python - 类型错误 : '>=' not supported between instances of 'int' and 'str' even with adding int to the front of score

python - 无法在 Jupyter 中导入 Keras

python - 循环返回整数之和