Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Python from server error: AttributeError: type object 'Retry' has no attribute

csh8428
11 - Bolide

I have a workflow that is trying to write to Smartsheet. It works locally, but not from desktop designer on the server

Local PC proxy settings: Automatically detect: off, use setup script: on, manual proxy setup Off

Server proxy settings: Automatically detect: off, use setup script: Off, manual proxy setup: Has an our proxy address and port, and api.smartsheet.com is in the exception list

Error: Python (1): ---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-5fde06af4566> in <module>
     82 }
     83 #initilaize smartsheet sheet and client. If using a proxy use the proxies=proxies section
---> 84 smart = ss.Smartsheet(proxies=proxies)             # Create a Smartsheet client
     85 
     86 
d:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\smartsheet\smartsheet.py in __init__(self, access_token, max_connections, user_agent, max_retry_time, proxies, api_base)
    165             self._user_calc_backoff = DefaultCalcBackoff(max_retry_time)
    166 
--> 167         self._session = pinned_session(pool_maxsize=max_connections)
    168         if proxies:
    169             self._session.proxies = proxies
d:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\smartsheet\session.py in pinned_session(pool_maxsize)
     54         pool_maxsize=pool_maxsize,
     55         max_retries=Retry(
---> 56             total=1, allowed_methods=Retry.DEFAULT_ALLOWED_METHODS.union(["POST"])
     57         ),
     58     )
AttributeError: type object 'Retry' has no attribute 'DEFAULT_ALLOWED_METHODS'

  

2 REPLIES 2
binuacs
21 - Polaris

@csh8428 may try to upgrade the package urllib3 and try again

 

pip install --upgrade urllib3

csh8428
11 - Bolide

I found the solution here

 

It seems to be a problem with a deprecated method from urllib3 (used by requests):
https://stackoverflow.com/questions/65289720/attributeerror-retry-object-has-no-attribute-method-whitelist

In my environment, installing python-keycloak-0.25.0 also installs requests-2.25.1 and urllib3-1.26.5. This works fine, but I started having this problem after running pip install against a requirements.txt file that I have for test purposes that downgrades the requirements.txt version to 2.24.0.

I guess that a quick fix would be to force freezing the requests and urllib3 packages to the versions that are installed by default (that seem to work fine):

pip install requests==2.25.1 urllib3==1.26.5
Labels