The command line output is normal, but pycharm prints an error. I tried gbk and utf-8 file encoding but neither worked. As shown below:
It turns out that you need to set the system and project-level encoding in pycharm and set them to utf-8. As shown below: