Py2Exe找不到模块

时间:2017-01-06 10:42:40

标签: python py2exe winpcap

我试图“编译”脚本,包括我用

手动编译的包“pcapy”
python setup.py install 

但是py2exe找不到他。我试过在setup.py中添加选项

options={
        "py2exe":{
                "packages": ["pcapy"]
        }
}

但它没有帮助。我得到的错误(如果将“include”更改为“packages”,则相同)

running py2exe
*** searching for required modules ***
Traceback (most recent call last):
  File "setup.py", line 8, in <module>
    "includes": ["pcapy"]
  File "C:\Python27\Lib\distutils\core.py", line 151, in setup
    dist.run_commands()
  File "C:\Python27\Lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 243, in run
    self._run()
  File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 296, in _run
    self.find_needed_modules(mf, required_files, required_modules)
  File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 1297, in find_needed_modules
    mf.import_hook(mod)
  File "C:\Python27\lib\site-packages\py2exe\mf.py", line 719, in import_hook
    return Base.import_hook(self,name,caller,fromlist,level)
  File "C:\Python27\lib\site-packages\py2exe\mf.py", line 136, in import_hook
    q, tail = self.find_head_package(parent, name)
  File "C:\Python27\lib\site-packages\py2exe\mf.py", line 204, in find_head_package
    raise ImportError, "No module named " + qname

ImportError:没有名为pcapy的模块

1 个答案:

答案 0 :(得分:0)

您是否尝试过包含&#39; pcapy&#39; ?

{{1}}