AnsweredAssumed Answered

Arcpy fails to import in Spyder

Question asked by jborgion Champion on Oct 2, 2018
Latest reply on Oct 26, 2018 by Dan_Patterson

Today I'm working in Spyder just like any other day but when I try to import arcpy, I get this:

 

import datetime

import os

import arcpy
Traceback (most recent call last):

  File "<ipython-input-3-5467a3dc9fe3>", line 1, in <module>
    import arcpy

  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py", line 72, 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

RuntimeError: Not signed into Portal.

 

I imported datetime & os just to see if they worked okay and they do;  I get this error if I let the console window sit long enough. I'm curious what the connection is with arcpy, spyder, python and Portal/ArcGIS Online is and how I can avoid this in the future....

 

eta moments later....  Shut down spyder and reopened it: cured.... (?)

Outcomes