Select to view content in your preferred language

Install untools breaks arcgis.gis connexion

346
2
Jump to solution
06-27-2024 02:27 PM
PierreloupDucroix
Occasional Contributor III

Hello,

after upgrading to Pro 3.3, I created a new python clone environment.

After that, I can create a GIS connection in python using arcgis.gis.GIS(**PORTAL)

But, then, I installed untools and it broke the GIS connection.

Now I have this error :

Traceback (most recent call last):
File "***\rebuild.py", line 71, in <module>
portalTigre = arcgis.gis.GIS(**PORTAL)
^^^^^^^^^^^^^^^^^^^^^^^^
File "***\Lib\site-packages\arcgis\gis\__init__.py", line 637, in __init__
raise e
File "***\Lib\site-packages\arcgis\gis\__init__.py", line 576, in __init__
self._portal = _portalpy.Portal(
^^^^^^^^^^^^^^^^^
File "***\Lib\site-packages\arcgis\gis\_impl\_portalpy.py", line 210, in __init__
self.con = Connection(
^^^^^^^^^^^
File "***\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 356, in __init__
self._create_session()
File "***\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 588, in _create_session
if self._check_product() == "SERVER":
^^^^^^^^^^^^^^^^^^^^^
File "***\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 1961, in _check_product
res = self.get(baseurl + "/info", params={"f": "json"})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "***\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 853, in get
raise Exception("A general error occurred: %s" % e)
Exception: A general error occurred: maximum recursion depth exceeded

More info :

PierreloupDucroix_0-1719525978726.png

I did it twice with the same result

Any idea ?

0 Kudos
1 Solution

Accepted Solutions
PaulLeBlanc1
Esri Regular Contributor

The issue is with the requests library. conda updated this package during the installation of untools (despite untools not even using it).

You need requests >=2.30.0,<2.32.0

I was able to reproduce this and confirmed that downgrading to requests 2.31.0 resolved it.

View solution in original post

2 Replies
PaulLeBlanc1
Esri Regular Contributor

The issue is with the requests library. conda updated this package during the installation of untools (despite untools not even using it).

You need requests >=2.30.0,<2.32.0

I was able to reproduce this and confirmed that downgrading to requests 2.31.0 resolved it.

PierreloupDucroix
Occasional Contributor III

Thanks Paul,

pip install requests==2.31.0 did resolve the bug.

Weirdly, conda install requests=2.31.0 does nothing...

0 Kudos