1、动作:StringIO 参考:http://stackoverflow.com/questions/11914472/stringio-in-python3 try: from StringIO import StringIO except ImportError: from io import StringIO /2、动作:import docx错误:No module named 'exceptions'参考:http://stackoverflow.com/questions/22765313/when-import-docx-in-python3-3-i-have-error-importerror-no-module-named-excepti-from exceptions import PendingDeprecationWarning +# Handle PendingDeprecationWarning causing an ImportError if using Python 3 +try: + from exceptions import PendingDeprecationWarning +except ImportError: + pass +