0

I had read this and installed pywin32 from this place, both Python27 and Python36.

However I got the error. I don't know why. I tried both Python27 and Python36. The errors are identical.

enter image description here

To be more detailed, I put my sample code below:

 import win32com.client
 from win32com.client import constants, DispatchBaseClass, CastTo, VARIANT
 import sys

 mode = win32com.client.VARIANT(pythoncom.VT_BSTR | pythoncom.VT_BYREF, "")

Result after delete the old Python, reinstalled both ActivePython 3.6 and pywin32com package. Screen shot like below:

enter image description here

Is there any workaround which needn't use the pythoncom?

Wason
  • 1,341
  • 1
  • 13
  • 26
  • Did you install ActivePython as suggested in the accepted answer in the thread you mentioned? – AcK Jun 20 '18 at 13:46
  • After reading your comment, I deleted the original python and reinstall an ActivePython3.6, then reinstalled pywin32com, but no lucky. I'm trying ActivePython2.7... – Wason Jun 21 '18 at 03:02
  • for your own good install linux – sandes Jun 21 '18 at 03:38

1 Answers1

0

Install pywin32. Copy the files from pywin32_system32 path to win32

EKNATH KULKARNI
  • 394
  • 1
  • 5
  • 13