ImportError: Cannot load backend ‘TkAgg’ which requires the ‘tk’ interactive framework, as ‘headless’ is currently running

What solved the problem for me was to restart my kernel, import the following first:

import matplotlib
matplotlib.use('TKAgg')

Then,

import matplotlib.pyplot as plt

You probably imported matplotlib with another framework before you tried to change to TKAgg. Restart your kernel.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)