Getting ActivePython to work with WSH

断了今生、忘了曾经 提交于 2019-12-30 04:33:30

问题


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.


回答1:


To fix this:

  1. Install Python for Windows Extensions (PyWin32)
  2. Register python, C:\YourPythonVersion\Lib\site-packages\win32comext\axscript\client\pyscript.py


来源:https://stackoverflow.com/questions/7637210/getting-activepython-to-work-with-wsh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!