Py2Exe can't find module

741 views Asked by At

I've trying to "compile" script including package "pcapy", that I manually compiled with

python setup.py install 

but py2exe can't find him. I've tried to add option in setup.py

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

But it's not helped. Error that I've got(same if change "include" to "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: No module named pcapy

1

There are 1 answers

3
Maurice Meyer On

Did you try to include 'pcapy' ?

options = {
    "py2exe": {
        "includes": ["pcapy"],
        "excludes": [...],
        "packages": [...],
        ...
     }
}