(7)如果没有指定--include-path,或者没有在某个.py文件中写上import _elementpath as DONTUSE,都会出现如下找不到_elementpath模块的错误: D:\Projects\Google\pyblogpost\2exe\dist>BlogPost.exe
Traceback (most recent call last):
File "D:\Projects\Google\pyblogpost\2exe\BlogPost.py", line 11, in <module>
import BlogConfig
File "BlogConfig.py", line 5, in <module>
File "ExtensionLoader_lxml_etree.py", line 12, in <module>
File "lxml.etree.pyx", line 39, in init lxml.etree (src/lxml/lxml.etree.c:1399
44)
ImportError: No module named _elementpath
(8)不能有中文,即使是注释中也不能有,否则出现如下错误。
codeString = fp.read()
File "C:\Python31\lib\codecs.py", line 300, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 557-558: invalid
data
尝试把编码由cp936改为utf-8,也不可以,把文件中ASCII另存为UTF-8,也不行,有如下错误:
File "BlogConfig.py", line 1
\ufeff#!/usr/bin/python
^