Notebook ArcGIS Online login failure

I am trying to migrate form a jupyter notebook to a datalore notebook, so the code I expected to work with no issues. I get an error message after running the code below:

from arcgis.gis import GIS
from IPython.display import display

Log into ArcGIS Online

print(“ArcGIS Online Org account”)
gis = GIS(“”, “XXXXXXX”, “xxxxxxxxx”)
print("Logged in as " + str(

error message:

Traceback (most recent call last):
at block 2, line 26
NameError: name ‘torch’ is not defined
import torch

where line 26 is this one:
gis = GIS(“”, “XXXXXXX”, “xxxxxxxxx”)

I dont know why I get a suggestion to import torch… a library that I have never used?

1 Like

Thank you for the report, this is indeed a strange issue, I’ve reproduced it. Will investigate and come with a solution

When you instantiate GIS, arcgis tries to initialize its component called AccGIS Learn, which requires some extra dependencies, including PyTorch. You can deactivate it by setting the environment variable called DISABLE_ARCGIS_LEARN to 1:

import os
os.environ['DISABLE_ARCGIS_LEARN'] = '1'

Thanks. It works.