Error: Namespace packages not yet supported: Skipping package 'pywintypes'

1.1k Views Asked by At

I am trying to use Py2exe to create a executable file for a app that uses webview to load a website, created using pywebview package on pip but I keep on getting this error that says:-

running py2exe
Error: Namespace packages not yet supported: Skipping package 'pywintypes'
Error: Namespace packages not yet supported: Skipping package 'pywintypes'
Error: Namespace packages not yet supported: Skipping package 'pywintypes'
Traceback (most recent call last):
  File "py2exe_setup.py", line 59, in <module>
    zipfile=None)
  File "C:\Python34\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Python34\lib\site-packages\py2exe\distutils_buildexe.py", line 188, in run
    self._run()
  File "C:\Python34\lib\site-packages\py2exe\distutils_buildexe.py", line 267, in _run
    builder.analyze()
  File "C:\Python34\lib\site-packages\py2exe\runtime.py", line 164, in analyze
    mf.import_hook(modname)
  File "C:\Python34\lib\site-packages\py2exe\mf3.py", line 120, in import_hook
    module = self._gcd_import(name)
  File "C:\Python34\lib\site-packages\py2exe\mf3.py", line 274, in _gcd_import
    return self._find_and_load(name)
  File "C:\Python34\lib\site-packages\py2exe\mf3.py", line 341, in _find_and_load
    self._load_module(loader, name)
  File "C:\Python34\lib\site-packages\py2exe\mf3.py", line 372, in _load_module
    self._add_module(name, mod)
  File "C:\Python34\lib\site-packages\py2exe\dllfinder.py", line 209, in _add_module
    self.hook(mod)
  File "C:\Python34\lib\site-packages\py2exe\dllfinder.py", line 206, in hook
    mth(self, mod)
  File "C:\Python34\lib\site-packages\py2exe\hooks.py", line 250, in hook_win32api
    finder.import_hook("pywintypes")
  File "C:\Python34\lib\site-packages\py2exe\mf3.py", line 120, in import_hook
    module = self._gcd_import(name)
  File "C:\Python34\lib\site-packages\py2exe\mf3.py", line 274, in _gcd_import
    return self._find_and_load(name)
  File "C:\Python34\lib\site-packages\py2exe\mf3.py", line 337, in _find_and_load
    raise ImportError(name)
ImportError: pywintypes

The error pops on while executing an example on github on the link below:- https://github.com/r0x0r/pywebview/blob/master/examples/py2exe_setup.py

1

There are 1 best solutions below

0
On

I had the same error as you and I just installed the "pywin32" Library and it worked. Note that I have installed Anaconda3 before that and so I used conda to install the pywin32 package:

conda install pywin32