3

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 file. 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

1
  • Don't you need a module to link IIS with Python? Commented May 26, 2011 at 13:27

2 Answers 2

3

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.
Sign up to request clarification or add additional context in comments.

Comments

1

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

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

python pyscript.py register

1 Comment

Solved the problem for me too. I needed Python registered as an Active Scripting language.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.