Tkinter Canvas not showing

Solution for Tkinter Canvas not showing
is Given Below:

I want to know why my canvas is not showing up.

I want to create a weather app with a home screen where you put your city, Then press a button and get the weather app, I’m using command=function in my button code but the weather app appears without the canvas,

I’m using Pycharm Professional and Python 3.9

I get no errors in the console when running it

# importing requests and json
import requests, json
from tkinter import *
y = Tk()

y.geometry("500x500")
cvwid2 = 700
cvhei2 = 700
canvasi = Canvas(y, width=cvwid2, height=cvhei2, bg='black')

canvasi.pack(expand=YES, fill=BOTH)


imagei = 'images/home.png'
gif12 = PhotoImage(file=imagei)



canvasi.create_image(0, 0, image=gif12, anchor=NW)
e = Entry(y, width=50)
e.place(x=50,y=250)
CITY = e.get()
def func() :
BASE_URL = "https://api.openweathermap.org/data/2.5/weather?"
URL = "https://api.openweathermap.org/data/2.5/weather?q=+" +  
CITY + "&units=metric&APPID=0316f9e49bb4c3fe9c8ea0327ea5a71e"
response = requests.get(URL)
if response.status_code == 200:

  data = response.json()
  main = data['main']
  temperature = main['temp']
  humidity = main['humidity']
  pressure = main['pressure']
  report = data['weather']
  print(f"{CITY:-^30}")
  print(f"Temperature: {temperature}")
  print(f"Humidity: {humidity}")
  print(f"Pressure: {pressure}")
  print(f"Weather Report: {report[0]['description']}")




  rep = report[0]['main'].lower()

  if "clear" in rep :
     image="images/sunny.png"
  if "cloud" in rep :
     image="images/cloud.png"
  if "rain" in rep :
     image="images/rain.png"
  if "thunder" in rep :
     image="images/thunder.png"
  if "mist" in rep :
     image="images/mist.png"
  if "snow" in rep :
     image="images/snow.png"

  x = Toplevel()
  x.resizable(False, False)
  gif = PhotoImage(file=image)
  cvwid = 700
  cvhei = 700
  canvas = Canvas(y, width=cvwid, height=cvhei, bg='blue')
  canvas.pack(fill=BOTH)

  img = canvas.create_image(0,0, image=gif, anchor=NW)

  temp = canvas.create_text(cvwid / 2, 350,fill="White",font="Helvetica 30", text=str(int(temperature)) + "°C")
  reportr = canvas.create_text(cvwid / 2, 400,fill="White",font="Helvetica 20", text=report[0]["main"])
  x.mainloop()


b = Button(y, text="Choose Country", command=func)
b.place(x=50, y=300) 
y.mainloop()