Cx_freeze with lxml.html TypeError

六眼飞鱼酱① 提交于 2019-12-11 14:54:48

问题


import lxml.html

Gives me error when i want to compile with 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

When i delete this import all is OK, but i need to use lxml.html not importing it solves nothing :(


回答1:


The error you are getting indicates that module.parent.path is returning NoneType. You probably need to make sure that lxml is in your PYTHONPATH.



来源:https://stackoverflow.com/questions/18600584/cx-freeze-with-lxml-html-typeerror

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!