Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 691
lsharma Avatar asked Jun 23 '26 03:06

lsharma


1 Answers

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.
like image 83
xiao 啸 Avatar answered Jun 24 '26 17:06

xiao 啸