Use tidyhtml library to clean up html before adding it to the enex content

All the entries in my starred.json file contain unclosed <img> tags as the first element. On import to evernote, no content display. As such I use tidyhtml to correct the html before adding it to the enex file. All 1313 of my notes import and display in Evernote after this. 

I would love to conditionally include the tidyhtml library because I know it may not be part of the standard python distribution. I dont know how to conditionally include it though. Do you?