Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7692449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:51:19+00:00 2026-05-31T20:51:19+00:00

Having a problem executing a Python script from a .NET web service. The web

  • 0

Having a problem executing a Python script from a .NET web service.

The web services creates a System.Diagnostics.Process for python.exe and passes a Python script path as an argument.

The web service is running as a custom local account. The python script succeeds if I add the custom local account to the administrators group but I can’t do this as a solution.

The Python script is failing to import a library from ESRI called ArcPy. It looks like this module utilizes a Java JAR to invoke ArcObjects from (ESRI’s API).

It only fails when run in the context of the web service. If I open a cmd shell using runas to run it as the web app pool custom account and call the python script it works fine (even when the app pool account is not in the administrators group). It only requires being in the administrators group when run as the web service.

I’ve looked through procmon for entries from w3wp.exe and python.exe but I haven’t found anything that I need to change permissions for.

I am wondering why it works from a shell running as the app pool account but not from the web service.

I grant every single local user rights assignment policy to the app pool account but it didn’t work so I’ve ruled that out.

I’ve also changed the web service app pool to load the user profile but that didn’t help either.

What’s different about the execution environment when a system.diagnostics.process is run in the context of an IIS app pool vs a shell running as the same account?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:51:20+00:00Added an answer on May 31, 2026 at 8:51 pm

    It turns out it had nothing to do with security. ESRI installs it’s instance of python and adds .PTH files to the Lib\site-packages directory.

    I have both ArcGIS Desktop and ArcGIS server installed and both have the ArcPy python module in there program files directories. Python was importing the wrong module because it was first in the path.

    The issue is documented in this ESRI KB.

    http://support.esri.com/en/knowledgebase/techarticles/detail/39029

    I have no idea why it worked when the account was in the administrators group though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having problems with executing a python script from a browser. My script
I'm having a problem with executing a stored procedure from Perl (using the DBI
I'm having a problem executing a command from a command line through an ASP
From Python Problem Set The three functions work correctly but they require executing one
So I'm new to Ajax in RoR and having first problem with executing .js.erb
I'm having a problem to track the Sequence of executing the following code :
Having a weird problem. I'm testing an ASP.NET application I wrote that queries SQL
I'm having a problem executing a certain bit of AJAX. Here is how I
I am having a problem where I want to stop a particular function from
I am having a problem in executing the following code while searching in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.