<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Error: __init__() got an unexpected keyword argument 'method_whitelist' in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1286413#M8662</link>
    <description>&lt;P&gt;Pretty much this same question from someone else&lt;A href="https://community.esri.com/t5/arcgis-enterprise-in-the-cloud-questions/arcgis-package-urllib3-library-issue/m-p/1286090#M599" target="_self"&gt; exists in another forum&lt;/A&gt;, but it has no answer. Figured I'd try my luck here. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'm working on an Azure function app in Python that just queries a table in ArcGIS Online. It seems to build just fine, but when used it throws the error in the subject line at the point when it attempts to log in to ArcGIS Online.&lt;/P&gt;&lt;P&gt;Curious what might be the cause and solution. Below is the full error:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;System.Private.CoreLib: Exception while executing function: Functions.getPercentages. System.Private.CoreLib: Result: Failure&lt;BR /&gt;Exception: TypeError: __init__() got an unexpected keyword argument 'method_whitelist'&lt;BR /&gt;Stack: File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9/WINDOWS/X64\azure_functions_worker\dispatcher.py", line 407, in _handle__invocation_request&lt;BR /&gt;call_result = await self._loop.run_in_executor(&lt;BR /&gt;File "C:\Python39\lib\concurrent\futures\thread.py", line 52, in run&lt;BR /&gt;result = self.fn(*self.args, **self.kwargs)&lt;BR /&gt;File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9/WINDOWS/X64\azure_functions_worker\dispatcher.py", line 649, in _run_sync_func&lt;BR /&gt;return ExtensionManager.get_sync_invocation_wrapper(context,&lt;BR /&gt;File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9/WINDOWS/X64\azure_functions_worker\extension.py", line 215, in _raw_invocation_wrapper&lt;BR /&gt;result = function(**args)&lt;BR /&gt;File "*****\getPercentages\__init__.py", line 34, in main&lt;BR /&gt;gis = GIS(url, user, pw)&lt;BR /&gt;File "*****\.venv\lib\site-packages\arcgis\gis\__init__.py", line 586, in __init__&lt;BR /&gt;raise e&lt;BR /&gt;File "*****\.venv\lib\site-packages\arcgis\gis\__init__.py", line 525, in __init__&lt;BR /&gt;self._portal = _portalpy.Portal(&lt;BR /&gt;File "*****\.venv\lib\site-packages\arcgis\gis\_impl\_portalpy.py", line 208, in __init__&lt;BR /&gt;self.con = Connection(&lt;BR /&gt;File "*****\.venv\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 353, in __init__&lt;BR /&gt;self._create_session()&lt;BR /&gt;File "*****\.venv\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 526, in _create_session&lt;BR /&gt;max_retries=Retry(&lt;BR /&gt;.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Fri, 05 May 2023 22:04:42 GMT</pubDate>
    <dc:creator>RogerAsbury</dc:creator>
    <dc:date>2023-05-05T22:04:42Z</dc:date>
    <item>
      <title>Error: __init__() got an unexpected keyword argument 'method_whitelist'</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1286413#M8662</link>
      <description>&lt;P&gt;Pretty much this same question from someone else&lt;A href="https://community.esri.com/t5/arcgis-enterprise-in-the-cloud-questions/arcgis-package-urllib3-library-issue/m-p/1286090#M599" target="_self"&gt; exists in another forum&lt;/A&gt;, but it has no answer. Figured I'd try my luck here. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'm working on an Azure function app in Python that just queries a table in ArcGIS Online. It seems to build just fine, but when used it throws the error in the subject line at the point when it attempts to log in to ArcGIS Online.&lt;/P&gt;&lt;P&gt;Curious what might be the cause and solution. Below is the full error:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;System.Private.CoreLib: Exception while executing function: Functions.getPercentages. System.Private.CoreLib: Result: Failure&lt;BR /&gt;Exception: TypeError: __init__() got an unexpected keyword argument 'method_whitelist'&lt;BR /&gt;Stack: File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9/WINDOWS/X64\azure_functions_worker\dispatcher.py", line 407, in _handle__invocation_request&lt;BR /&gt;call_result = await self._loop.run_in_executor(&lt;BR /&gt;File "C:\Python39\lib\concurrent\futures\thread.py", line 52, in run&lt;BR /&gt;result = self.fn(*self.args, **self.kwargs)&lt;BR /&gt;File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9/WINDOWS/X64\azure_functions_worker\dispatcher.py", line 649, in _run_sync_func&lt;BR /&gt;return ExtensionManager.get_sync_invocation_wrapper(context,&lt;BR /&gt;File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9/WINDOWS/X64\azure_functions_worker\extension.py", line 215, in _raw_invocation_wrapper&lt;BR /&gt;result = function(**args)&lt;BR /&gt;File "*****\getPercentages\__init__.py", line 34, in main&lt;BR /&gt;gis = GIS(url, user, pw)&lt;BR /&gt;File "*****\.venv\lib\site-packages\arcgis\gis\__init__.py", line 586, in __init__&lt;BR /&gt;raise e&lt;BR /&gt;File "*****\.venv\lib\site-packages\arcgis\gis\__init__.py", line 525, in __init__&lt;BR /&gt;self._portal = _portalpy.Portal(&lt;BR /&gt;File "*****\.venv\lib\site-packages\arcgis\gis\_impl\_portalpy.py", line 208, in __init__&lt;BR /&gt;self.con = Connection(&lt;BR /&gt;File "*****\.venv\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 353, in __init__&lt;BR /&gt;self._create_session()&lt;BR /&gt;File "*****\.venv\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 526, in _create_session&lt;BR /&gt;max_retries=Retry(&lt;BR /&gt;.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 05 May 2023 22:04:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1286413#M8662</guid>
      <dc:creator>RogerAsbury</dc:creator>
      <dc:date>2023-05-05T22:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error: __init__() got an unexpected keyword argument 'method_whitelist'</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1286652#M8663</link>
      <description>&lt;P&gt;Try to install requests 2.29.0 instead of the newest one 2.30&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 11:25:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1286652#M8663</guid>
      <dc:creator>MubaDev</dc:creator>
      <dc:date>2023-05-08T11:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Error: __init__() got an unexpected keyword argument 'method_whitelist'</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1286822#M8664</link>
      <description>&lt;P&gt;I'm getting the same issue here. Currently using arcgis 1.9.1, requests 2.28.1, urllib 1.26.12&lt;BR /&gt;Everything has been working fine for months, now getting&amp;nbsp;&lt;BR /&gt;__init__() got an unexpected keyword argument 'method_whitelist'&lt;BR /&gt;when trying to create a GIS object using the arcgis API&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 16:33:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1286822#M8664</guid>
      <dc:creator>TedChapin</dc:creator>
      <dc:date>2023-05-08T16:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Error: __init__() got an unexpected keyword argument 'method_whitelist'</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1286829#M8665</link>
      <description>&lt;P&gt;Added: requests==2.29.0&lt;/P&gt;&lt;P&gt;to my requirements file. Still getting the same error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT - I should say... This works LOCALLY (I run the code from Visual Studio Code and it accepts input and returns data) but when uploaded to Azure it still produces the same error.&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 16:54:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1286829#M8665</guid>
      <dc:creator>RogerAsbury</dc:creator>
      <dc:date>2023-05-08T16:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error: __init__() got an unexpected keyword argument 'method_whitelist'</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1286970#M8667</link>
      <description>&lt;P&gt;After also resetting urllib3 to a lower version, &lt;A href="https://learn.microsoft.com/en-us/answers/questions/1276637/arcgis-package-urllib3-library-issue" target="_self"&gt;per this answer&lt;/A&gt;, it finally worked.&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 19:17:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1286970#M8667</guid>
      <dc:creator>RogerAsbury</dc:creator>
      <dc:date>2023-05-08T19:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Error: __init__() got an unexpected keyword argument 'method_whitelist'</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1287178#M8668</link>
      <description>&lt;P&gt;Good Morning Roger&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We came across the same problem with a client.&amp;nbsp; As per&amp;nbsp;&lt;A href="https://github.com/urllib3/urllib3/issues/2092" target="_blank"&gt;https://github.com/urllib3/urllib3/issues/2092&lt;/A&gt;&amp;nbsp;it looks like the method_whitelist keyword has been replaced with the allowed_methods keyword in urllib3 this has not been changed in the arcgis api however which causes it to break.&amp;nbsp; We fixed this by going back to a previous version of the arcgis api for python 1.8.4. which solved it for us.&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 10:38:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1287178#M8668</guid>
      <dc:creator>dvonck</dc:creator>
      <dc:date>2023-05-09T10:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error: __init__() got an unexpected keyword argument 'method_whitelist'</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1287211#M8669</link>
      <description>&lt;P&gt;For publishing Azure Functions that use arcgis api, I am using arcgis==1.9.1 per this thread:&amp;nbsp;&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/suddenly-can-t-build-and-deploy-python-azure/td-p/1205235" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-python-questions/suddenly-can-t-build-and-deploy-python-azure/td-p/1205235&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As mentioned in this original post, this week we started getting the error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Error: __init__() got an unexpected keyword argument 'method_whitelist'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked at the urllib version that got installed when I created a project a while ago using pip install arcgis==1.9.1. The version of urllib3 that got installed at that time was 1.26.12&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TedChapin_2-1683637056067.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70222iE37EA77B8CD7876A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TedChapin_2-1683637056067.png" alt="TedChapin_2-1683637056067.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Today I created a fresh new Azure Function and used pip install arcgis==1.9.1 and the version of urllib3 that got installed today is 2.0.2&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TedChapin_3-1683637070470.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70223i514C088FDFDFE062/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TedChapin_3-1683637070470.png" alt="TedChapin_3-1683637070470.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, something changed recently in Esri's specification of what version of urllib3 to use, even for older versions of arcgis api. Apparently the update in terminology to replace "whitelist_methods" with "allowed_methods" has proceeded in urllib3 but has not been updated in arcgis api.&lt;/P&gt;&lt;P&gt;For reference, here is a Github issue:&lt;BR /&gt;&lt;A href="https://github.com/Esri/arcgis-python-api/issues/1553" target="_blank"&gt;https://github.com/Esri/arcgis-python-api/issues/1553&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and related post in this forum:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-enterprise-in-the-cloud-questions/arcgis-package-urllib3-library-issue/m-p/1286090#M599" target="_blank"&gt;https://community.esri.com/t5/arcgis-enterprise-in-the-cloud-questions/arcgis-package-urllib3-library-issue/m-p/1286090#M599&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 12:58:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1287211#M8669</guid>
      <dc:creator>TedChapin</dc:creator>
      <dc:date>2023-05-09T12:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Error: __init__() got an unexpected keyword argument 'method_whitelist'</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1288057#M8682</link>
      <description>&lt;P&gt;In our case, for the time being:&lt;BR /&gt;&lt;BR /&gt;arcgis 1.9.1 +&amp;nbsp;urllib3 1.26.15 (1.26.5 as per Microsoft answer also works)&lt;/P&gt;&lt;P&gt;did the trick&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 08:28:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1288057#M8682</guid>
      <dc:creator>InfodimGIS</dc:creator>
      <dc:date>2023-05-11T08:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error: __init__() got an unexpected keyword argument 'method_whitelist'</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1292021#M8714</link>
      <description>&lt;P&gt;What should be the order in the requirements.txt? First the arcgis 1.9.1 and then the urllib3 1.26.13 or vice versa?&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 12:20:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1292021#M8714</guid>
      <dc:creator>LorenzMeyer1</dc:creator>
      <dc:date>2023-05-23T12:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Error: __init__() got an unexpected keyword argument 'method_whitelist'</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1292023#M8715</link>
      <description>&lt;P&gt;General question to deploying azure functions with arcgis library.&amp;nbsp; How do you deploy them? I run a zip deployment, but the deployment process sometimes hangs, sometimes times out. In my opinion a pain. And tipps and tricks?&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 12:22:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1292023#M8715</guid>
      <dc:creator>LorenzMeyer1</dc:creator>
      <dc:date>2023-05-23T12:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Error: __init__() got an unexpected keyword argument 'method_whitelist'</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1294813#M8744</link>
      <description>&lt;P&gt;Thanks A LOT! Have been stuck with it, my Google Cloud function suddenly stopped deploying few weeks ago. I tried going back several versions up to&amp;nbsp; to 1.9.1, but finally it worked for 1.8.4 as you suggested. Thank you again!&amp;nbsp; &amp;nbsp;&lt;span class="lia-unicode-emoji" title=":clapping_hands:"&gt;👏&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 21:57:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1294813#M8744</guid>
      <dc:creator>GilMastrapa</dc:creator>
      <dc:date>2023-05-31T21:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error: __init__() got an unexpected keyword argument 'method_whitelist'</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1294920#M8745</link>
      <description>&lt;P&gt;Don't know about Azure, but having a similar issue with google cloud functions. My conclussion is that the env gets too heavy, it seems that arcgis have A LOT of mandatory dependencies, including jupyter (which seems unnecessary for cloud env). Even the docker image provided by esri is heavy (+1gb). Ideally ESRI developers should provide better support for 'barebones' installation, minimun dependencias are not well defined in the documentation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 12:12:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1294920#M8745</guid>
      <dc:creator>GilMastrapa</dc:creator>
      <dc:date>2023-06-01T12:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error: __init__() got an unexpected keyword argument 'method_whitelist'</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1296000#M8755</link>
      <description>&lt;P&gt;this worked wonderfully. thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 20:37:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-init-got-an-unexpected-keyword-argument/m-p/1296000#M8755</guid>
      <dc:creator>JosiahParry</dc:creator>
      <dc:date>2023-06-05T20:37:40Z</dc:date>
    </item>
  </channel>
</rss>

