python – plot a histogram with imported data(tensorflow)

So I’ve spent some time on learning tensorflow, specifically on
and I had a problem with making the histogram using PyCharm, the codes running on google collab were completely fine, but they didn’t work on PyCharm, like dftrain.age.hist(bins=10), I tried using print() or show() but both didn’t work, the initial one gave me this: AxesSubplot(0.125,0.11;0.775×0.77)
but the latter showed an error: image

I would very appreciate if someone help me, also just ask me which part you don’t get, I’ll try to clarify it asap.