Nuitka: 'pythoncom' is not defined

I get the following error when I run main.exe after I compile with python -m nuitka --standalone --mingw64 --follow-imports --enable-plugin=numpy-plugin main.py:

Traceback (most recent call last):
  File "C:\Users\IEUser\Desktop\o\main.dist\main.py", line 24, in <module>
  File "C:\Users\IEUser\Desktop\o\main.dist\c\i.py", line 24, in __init__
  File "C:\Users\IEUser\Desktop\o\main.dist\c\opc.py", line 11, in __init__
  File "C:\Users\IEUser\Desktop\o\main.dist\OpenOPC.py", line 155, in __init__
NameError: name 'pythoncom' is not defined

My setup is:

Python: 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] (It is installed with Windows installer) [no more versions of python installed]
Nuitka 0.6.2 (it is installed with pip)
MinGW-64 8.1.0 (win32 threads and x86_64 architecture) (It is installed with Windows installer)
Windows 10 64bits [fresh and clean original installation]
Arch: x86_64

If I am right pythoncom is in pywin32 module and I have installed it using pip.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 30 (17 by maintainers)

Most upvoted comments

If you find the above invocation string a little lengthy: try nuitka-sa.py. It does all of the above internally and you can invoke with python nuitka-sa.py yourscript.py.