0
import lxml.html

当我想用 cx_freeze 编译时给我错误:

   Traceback (most recent call last):
  File "C:\Python27\Scripts\cxfreeze", line 5, in <module>
    main()
  File "C:\Python27\lib\site-packages\cx_Freeze\main.py", line 188, in main
    freezer.Freeze()
  File "C:\Python27\lib\site-packages\cx_Freeze\freezer.py", line 572, in Freeze
    self._FreezeExecutable(executable)
  File "C:\Python27\lib\site-packages\cx_Freeze\freezer.py", line 186, in _FreezeExecutable
    exe.copyDependentFiles, scriptModule)
  File "C:\Python27\lib\site-packages\cx_Freeze\freezer.py", line 554, in _WriteModules
    path = os.pathsep.join([origPath] + module.parent.path)
TypeError: can only concatenate list (not "NoneType") to list

当我删除这个导入时一切正常,但我需要使用 lxml.html 不导入它什么都解决不了:(

4

1 回答 1

0

您收到的错误表明module.parent.path正在返回NoneType。您可能需要确保它lxml在您的PYTHONPATH.

于 2013-09-03T20:16:42.203 回答