Select to view content in your preferred language

ArcPy script called from Service ERROR (Python3). Not Signed into Portal

02-05-2020 06:33 PM
by Anonymous User
Not applicable

Hi all,

Any help would be much appreciated...... Shane Buscher & Arne Gelfert

When attempting to run a python 3 script, that imports arcpy, from an service, I am receiving the following runtime error:

 File "C:\", line 13, in <module>
import arcpy
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\", line 74, in <module>
from arcpy.geoprocessing import gp
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\", line 14, in <module>
from ._base import *
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\", line 14, in <module>
import arcgisscripting
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgisscripting\", line 1, in <module>
from ._arcgisscripting import *
RuntimeError: Not signed into Portal.

The script runs fine when I run it through command prompt, either specifying the propy.bat or the python3 interpreter.

 eg: "C:\Program Files\ArcGIS\Pro\bin\Python\Scripts\propy.bat" C:\ scenario currentsdir windsdir

I understand that when running a python script in the 3.x when importing arcpy it verifies that the install of ArcGIS Pro is licensed.

Based on other articles I have tried the following with no success...

  1. Licensed ArcGIS Pro for offline use
  2. Ensured that the service is running under the same account that ArcGIS pro is installed and licensed



ArcPy fails to import when not logged into host machine 

Avoiding arcgisscripting RuntimeError: Not signed into Portal from ArcPy with ArcGIS Pro? - Geograph... 





As a note, I have successfully run a 2.x python script from the service so the issue is definitely with python 3.x and obtaining a license.

0 Kudos
1 Reply
Regular Contributor

I think you might have to actually run Pro once as the user that will run your script. I remember something like that I had to do recently. 

0 Kudos