9

I've installed ActivePython 2.7.2 and I'm trying to execute a .pys script via the console with wscript/cscript, [i.e. ActivePython (PythonScript with .pys extension) in Microsoft's WSH(Windows Scripting Host)] and when trying with wscript I get two errors.

  1. "The program cannot start because MSVCR90.dll is missing from your computer try reinstalling the program to fix this problem"
  2. "Can't find script engine Python for script

I did some googling and have also downloaded and installed the Microsoft Visual C++ Redistributable Package (x86) from here: http://www.microsoft.com/download/en/confirmation.aspx?id=29 to no avail.

I've tried 'pythonw c:\Python27\Lib\site-packages\win32comext\axscript\client\pyscript.py' to register python.

Any help would be greatly appreciated.

I'm running on Win7 x86.

Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187
ldmvcd
  • 968
  • 3
  • 10
  • 15
  • 2
    I've now installed Python for Windows Extensions and now I can run the .pys with cscript in the console window (displays output in the console), but with wscript it does nothing, I expected it to pop up a window with the output. – ldmvcd Oct 03 '11 at 16:08
  • did you solved the issue ? – Eduard Florinescu Jul 11 '13 at 09:27

1 Answers1

8

To fix this:

  1. Install Python for Windows Extensions (PyWin32)
  2. Register python, C:\YourPythonVersion\Lib\site-packages\win32comext\axscript\client\pyscript.py
Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187
ldmvcd
  • 968
  • 3
  • 10
  • 15
  • Step 1 is not required for ActivePython. – Sridhar Ratnakumar Oct 04 '11 at 16:22
  • 1
    @Sridhar Oddly enough for me, step 1 actually fixes the problem (i.e., manually reinstalling pywin32), while _step 2 was not required_. I suppose that on Windows 7/Vista systems, for whatever reason pyscript.py does not correctly register itself, while Mark Hammond's pywin32 installer does. – Jerry Chong Oct 17 '11 at 04:08