question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'pythoncom' is not defined

See original GitHub issue

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.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
JorjMcKiecommented, Mar 13, 2019

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.

0reactions
kayhayencommented, Dec 15, 2021

This has never gotten a good reproducer, but pythoncom has been solved in the mean time, and the crash was a bug deal t with in another issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NameError: name 'pythoncom' is not defined · Issue #8 - GitHub
PlatForm : Windows 7 X64 , Python version : 3.7 when I use : import OpenOPC opc = OpenOPC.client() Pycharm raise an error...
Read more >
name 'pythoncom' is not defined - Stack Overflow
I tried both Python27 and Python36. The errors are identical. enter image description here. To be more detailed, I put my sample code...
Read more >
NameError: global name 'pythoncom' is not defined - Daniweb
I ask the DaniWeb Community for guidance in resolving the following NameError. I have attached the import (OpenOPC for Python Library Module), ...
Read more >
[python-win32] How to catch a COM error
Below is the code I'm trying but it's not working. I get ... NameError: name 'com_error' is not defined ... com_error is in...
Read more >
OpenOPC Python Client on Linux - SourceForge
NameError: global name 'pythoncom ' is not defined. pythoncom isn't available for Debian. Any idea what I can do? regards
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found