Hello everyone,
I am trying to run the webpage using IIS server where users will run the Python scripts from the website. For instance, my website is hosted through IIS, forester can go into one of the webpage and then according to his needs program will start running a calculation process, python file will work in the backend and then display the results.
But in this process I am facing a problem saying arcgis pro license is not initialized.
import arcpy
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__in
Traceback (most recent call last):
File "\\my_server_name\GIS_SSD\python_scripts\Culvert_Size_107a.py", line 21, in <module>
import arcpy
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py", line 77, in <module>
from arcpy.geoprocessing import gp
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\__init__.py", line 14, in <module>
from ._base import *
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 14, in <module>
import arcgisscripting
File "E:\ArcGISPro_Python\Python\envs\arcgispro-py3\Lib\site-packages\arcgisscripting\__init__.py", line 131, in <module>
from ._arcgisscripting import *
RuntimeError: The Product License has not been initialized.
However, when I run the same script through the ArcGIS Pro command prompt, it works fine. According to the ArcGIS Pro License Manager, the License Server Status shows "Running" and "Authorized". I have ensured that the application pool for my ArcGIS ProPython.exe file/folder has the proper security rights (using .NET v4.8 Classic). This is the pool I created in IIS Manager.
I don't understand why the python scripts work fine through the command prompt but do not work through the website.
This is the Python script it generates from the website and works fine locally: E:\ArcGISPro_Python\Python\envs\arcgispro-py3\python.exe \\my_servername.com\GIS_SSD\python_scripts\Culvert_Size_107a.py "2439099.12109375 7616263.95670573" "Culvert_Size_107a.py "2439099.12109375 7616263.95670573""
In my .NET code I have also mentioned the valid python path as shown below
Is there any suggestion you all think of? Thank you in advance.
Hi @PrayagShah,
Have you tried executing this from the website, by keeping an open instance of ArcGIS Pro?