开发者

The scripting language 'Python' is not found on the server

开发者 https://www.devze.com 2023-03-08 08:31 出处:网络
I am trying to run a python sample test page but am unable to do so.. I have installed python27 and it installed fine. Then I created a test folder in inetpub/wwwroot. Here I placed my test.py fil开发

I am trying to run a python sample test page but am unable to do so.. I have installed python27 and it installed fine. Then I created a test folder in inetpub/wwwroot. Here I placed my test.py fil开发者_JS百科e. Then I opened IIS 6.

Select the test site.

Right clicked it -> properties -> select create button. Then select scripts and executables from dropdown for execute permissions. Then I clicked the configuration button and added a new mapping with executable c:\Python27\python.exe -u "%s" "%s"and select all verbs.

Then I tried to run the file and it didn't work: http://localhost/test/test.py

I received the following error Error Type: Active Server Pages, ASP 0129 (0x80004005) The scripting language 'Python' is not found on the server. /test/python.asp, line 1


A quick google search find this tutorial about using IIS with python. It seems that you missed following steps:

Verify that application mapping for .py files is set up. To do this, perform the following steps:

  1. In the ISM, under Internet Information Server, right-click the computer name, and then click Properties.

  2. From the Master Properties drop-down list, click WWW Service and then click Edit.

  3. Click the Home Directory tab, and then click Configuration. To add the application mapping, click Add, and then create a new mapping by using the following information (substituting the correct path on your computer): Executable: "C:\Python20\python.exe %s %s" (The two "%s" after the executable are required for console-based script interpreters but would not be required for an Internet Server API [ISAPI]-based script interpreter). Extension: .py Script engine: selected.
  4. Check that File Exists: selected (for security) Click OK.


I came across this problem and registering python solved the problem.

cd C:\Python25\Lib\site-packages\win32comext\axscript\client

python pyscript.py register

0

精彩评论

暂无评论...
验证码 换一张
取 消