It appears that python on Windows is a PITA. So, I had your problem as well, I followed the following steps:
- Download Python from python.org. (you probably already have
that)
- Download PyWin32 from SourceForge.
- Download SetupTools from python.org.
- On your desktop or in the Start menu, right-click on My Computer then click Properties.
- In the Advanced tab, click Environment Variables.
- In the System Variables at the bottom, locate the PATH variable and double-click on it.
- Add
C:\Python27\
and C:\Python27\scripts
at the end of the Variable Value box (assuming you installed python in the location C:\Python27
).
- Click OK in all the dialogs.
It still did not work for me, however, I was puzzled by <python_install>\scripts
and found pywin32_postinstall.py
in there, running that did the trick!
- Execute \scripts\pywin32_postinstall.py
I kept getting the following trace:
Debugging extensions (axdebug) module does not exist - debugging is disabled..
I traced
it to Lib\site-packages\win32comext\axscript\client\framework.py
and commented out the trace
call that printed that message ... all good.
C:\Users\jdoe>type d:\python2vbs.wsf
<?XML Version="1.0" encoding="ISO-8859-1"?>
<?job error="true" debug="false"?>
<package>
<job>
<script language="VBScript">
<![CDATA[
public sub vbsOutput(strText)
wscript.echo strText & " (from vbsOutput)"
end sub
]]>
</script>
<script language="Python">
<![CDATA[
import sys
globals.vbsOutput('python testing')
]]>
</script>
</job>
</package>
C:\Users\jdoe>cscript d:\python2vbs.wsf
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.
python testing (from vbsOutput)
c:\Windows\SysWOW64\cscript.exe
. Looks like you used the default which is 64 bit on a 64 bit version of Windows.