How to update Python Tkinter to 8.6


When using the Tkinter module in Python, the phenomenon that the button characters are not displayed occurred. After investigating, it seems to be a bug in Tkinter 8.5. This bug can be fixed by updating Tkinter, but at this time (December 9, 2019) there is no official way to update Tkinter. Several sites have shown how to update Tkinter, which was to reinstall Python. But I still couldn't update Tkinter in my environment.

However, I was able to update Tkinter to 8.6 by using a program created by volunteers from overseas, so I will introduce it here.


MacOS Mojave 10.14.6 Python3.8.4

important point

I reinstall Python to update Tkinter, but this method only installs Python 3.8.4.

1. Install Xcode command line tools

If you don't have Xcode installed, install the Xcode command line tools.

$ xcode-select --install

2. Update homebrew to the latest version

$ brew update

3. Uninstall Python and Tkinter

Uninstall all Python and Tkinter from the installed packages such as homebrew and pyenv.

Uninstall Python

$ brew uninstall python
$ pyenv uninstall x.x.x

→ x is the version number.

Uninstall Tkinter

$ brew uninstall tcl-tk

Delete unnecessary cache

$ brew cleanup

4. Download the program

MacOS homebrew python 3.7.4 with tcl-tk (properly)

Download "python-with-tcl.rb" from the above site.

5. Replace the file

/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/python.rb Delete or put it somewhere else.

Rename the downloaded "python-with-tcl.rb" to "python.rb" /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ Put in.

6. Install Python

Install Python using the command below.

$ HOMEBREW_NO_AUTO_UPDATE=1 brew install --build-from-source python

7. Check the version of Tkinter

$ python -c "import tkinter;print(tkinter.TkVersion)"

It should be 8.6.

Reference URL

How to clean your Mac with brew cleanup to free up storage space MacOS homebrew python 3.7.4 with tcl-tk (properly) Cannot display png properly with tkinter8.5 on Mac → Upgraded tcl-tk by reinstalling Python of Pyenv

Recommended Posts

How to update Python Tkinter to 8.6
How to install Python
How to update easy_install
How to update Google Sheets from Python
How to install python
How to update Spyder
[Python / Tkinter] How to pass arguments to command
How to use tkinter with python in pyenv
[2020.8 latest] How to install Python
How to install Python [Windows]
[Python] How to use list 1
How to use Python argparse
How to update with SQLAlchemy?
Update python on Mac to 3.7-> 3.8
Python: How to use pydub
[Python] How to use checkio
How to run Notepad ++ Python
How to change Python version
How to develop in Python
[python] How to judge scalar
[Python] How to use input ()
How to rewrite Tkinter labels
How to use Python lambda
[Python] How to use virtualenv
python3: How to use bottle (3)
python3: How to use bottle
How to use Python bytes
Python update (2.6-> 2.7)
How to install python using anaconda
[Python] How to FFT mp3 data
[Python] How to do PCA in Python
Python: How to use async with
[Python] How to derive nCk (ABC156-D)
How to collect images in Python
How to update Spyder in Anaconda
How to use Requests (Python Library)
How to use SQLite in Python
[Introduction to Python] How to parse JSON
How to get the Python version
How to get started with Python
[Python] How to import the library
[Python] How to use list 3 Added
How to use Mysql in python
How to use OpenPose's Python API
[Python] How to swap array values
How to wrap C in Python
How to use ChemSpider in Python
How to use FTP with Python
Python: How to use pydub (playback)
How to use PubChem in Python
How to speed up Python calculations
How to calculate date with python
How to access wikipedia from python
How to use python zip function
[Nanonets] How to post Memo [Python]
How to handle Japanese in Python
[Python] How to use Typetalk API
Update Python on Mac from 2 to 3
How to do Bulk Update with PyMySQL and notes [Python]
How to update FC2 blog etc. using XMLRPC with python
[Python] How to convert db file to csv