I'm not sure why that line would cause an error. I just tried publishing the following script to an EXE and it worked fine on my machine:
Code:
import viz
viz.go()
import datetime
open_date = datetime.datetime.strptime("2012-04-04", "%Y-%M-%d").date()
viz.add('gallery.osgb')
Does this script work for you? How did you determine that line was causing the error?