After reading and searching, I find that
from calibre import ipython
ipython(locals())
code will not be useful, because now calibre do not conclude ipython.
So I think the
https://manual.calibre-ebook.com/develop.html#id14 need to change. And now what can I do to Using an interactive Python interpreter