A command to resolve Mac version Python idle cannot input Chinese question

Source: Internet
Author: User


After installing Python, there is usually an easy integration environment for idle, but on Mac, you can't use Chinese in idle.
There are two common types of failures:

  1. In idle, the Chinese input method simply does not work, does not eject the input box, all the input is treated as English.
    This is due to the idle use of the Tkinter graphics library, Tkinter use of the dependent library TCL/TK, in MacOS has a lower built-in version, which caused the Chinese cannot input the problem, the solution can be reinstalled using the high version tcl/tk compiled python , only one command is required under homebrew:

    brew reinstall python3 --with-tcl-tk

    For python2 users, replace "Python3" in the command above with "Python2". Then you can use Chinese in idle.

  2. Typing Chinese in idle or viewing a string containing Chinese will cause an error: "Unsupported characters in input"
    This is not the case in the latest python2.7.15 and python3.6.5. You can see if the system language is set to Chinese in individual cases.

A command to resolve Mac version Python idle cannot input Chinese question

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.