CLI: fix bug at setup.py - history

This PR fix bug at `setup.py`'s `history` command.
using `import` in function seems awkward. why don't you use `import` in the earlier part of this file?