A confusing bug in the process of making my own Anki addon

I use a Python module genanki to generate cards.But the image is always broken in the card.
My code are as follow
.
‘’’
import genanki

my_model = genanki.Model(
1091735104,
‘Simple Model with Media’,
fields=[
{‘name’: ‘Question’},
{‘name’: ‘Answer’},
{‘name’: ‘MyMedia’},
{‘name’: ‘MyAnswerMedia’} # ADD THIS
],
templates=[
{
‘name’: ‘Card 1’,
‘qfmt’: ‘{{Question}}
{{MyAnswerMedia}}’, # AND THIS
‘afmt’: ‘{{FrontSide}}


{{MyMedia}}
{{Answer}}’,
},
])

deckname = “newDeck”
decknumber = 987655
my_deck = genanki.Deck(
decknumber,
deckname)

my_note=genanki.Note(
model=my_model,
fields=[“test”,“test”, ‘’,“test”])
my_deck.add_note(my_note)

my_package = genanki.Package(my_deck)
my_package.media_files = [ “img_2991.jpg”]
genanki.Package(my_deck).write_to_file(deckname + r".apkg")
‘’’

By the way when I check the media file within apkg file and open it with notebook,it simply contain a {}.Can someone help me?

I recommend posting this in the repository of the developer.

Thanks a lot.I will do this.