Missed the Q4 Fall Release Product Update? Watch the on-demand webinar for more info on the latest in Designer 24.2, Auto Insights Magic Reports, and more!
Free Trial

Alteryx Designer Desktop Discussions

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

Python code error

mmurph200
7 - Meteor

I am getting the below error when I try to run the yxi file from this community post I believe I have set it up correctly and it has worked for others so not sure why I am getting the error. 

 

 

OCR (15)              Traceback (most recent call last):¶  File "C:\ProgramData\Alteryx\Tools\OCR\Lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen¶    httplib_response = self._make_request(¶  File "C:\ProgramData\Alteryx\Tools\OCR\Lib\site-packages\urllib3\connectionpool.py", line 386, in _make_request¶    self._validate_conn(conn)¶  File "C:\ProgramData\Alteryx\Tools\OCR\Lib\site-packages\urllib3\connectionpool.py", line 1042, in _validate_conn¶    conn.connect()¶  File "C:\ProgramData\Alteryx\Tools\OCR\Lib\site-packages\urllib3\connection.py", line 414, in connect¶    self.sock = ssl_wrap_socket(¶  File "C:\ProgramData\Alteryx\Tools\OCR\Lib\site-packages\urllib3\util\ssl_.py", line 449, in ssl_wrap_socket¶    ssl_sock = _ssl_wrap_socket_impl(¶  File "C:\ProgramData\Alteryx\Tools\OCR\Lib\site-packages\urllib3\util\ssl_.py", line 493, in _ssl_wrap_socket_impl¶    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)¶  File "C:\Program Files\Alteryx\bin\Miniconda3\lib\ssl.py", line 500, in wrap_socket¶    return self.sslsocket_class._create(¶  File "C:\Program Files\Alteryx\bin\Miniconda3\lib\ssl.py", line 1040, in _create¶    self.do_handshake()¶  File "C:\Program Files\Alteryx\bin\Miniconda3\lib\ssl.py", line 1309, in do_handshake¶    self._sslobj.do_handshake()¶ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)¶¶During handling of the above exception, another exception occurred:¶¶Traceback (most recent call last):¶  File "C:\ProgramData\Alteryx\Tools\OCR\Lib\site-packages\requests\adapters.py", line 489, in send¶    resp = conn.urlopen(¶  File "C:\ProgramData\Alteryx\Tools\OCR\Lib\site-packages\urllib3\connectionpool.py", line 787, in urlopen¶    retries = retries.increment(¶  File "C:\ProgramData\Alteryx\Tools\OCR\Lib\site-packages\urllib3\util\retry.py", line 592, in increment¶    raise MaxRetryError(_pool, url, error or ResponseError(cause))¶urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='tbcocr.cognitiveservices.azure.com', port=443): Max retries exceeded with url: /vision/v2.0/read/core/asyncBatchAnalyze (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))¶¶During handling of the above exception, another exception occurred:¶¶Traceback (most recent call last):¶  File "ocr.py", line 92, in ii_push_record¶  File "C:\ProgramData\Alteryx\Tools\OCR\Lib\site-packages\requests\api.py", line 115, in post¶    return request("post", url, data=data, json=json, **kwargs)¶  File "C:\ProgramData\Alteryx\Tools\OCR\Lib\site-packages\requests\api.py", line 59, in request¶    return session.request(method=method, url=url, **kwargs)¶  File "C:\ProgramData\Alteryx\Tools\OCR\Lib\site-packages\requests\sessions.py", line 587, in request¶    resp = self.send(prep, **send_kwargs)¶  File "C:\ProgramData\Alteryx\Tools\OCR\Lib\site-packages\requests\sessions.py", line 701, in send¶    r = adapter.send(request, **kwargs)¶  File "C:\ProgramData\Alteryx\Tools\OCR\Lib\site-packages\requests\adapters.py", line 563, in send¶    raise SSLError(e, request=request)¶requests.exceptions.SSLError: HTTPSConnectionPool(host='tbcocr.cognitiveservices.azure.com', port=443): Max retries exceeded with url: /vision/v2.0/read/core/asyncBatchAnalyze (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))¶

5 REPLIES 5
PanPP
Alteryx Alumni (Retired)

Hi @mmurph200 '

 

I would recommend following this article and modifying the cacert.pem file.

 

  • Admin installs: C:\ProgramData\Alteryx\Tools\TOOLNAME_vX.x.x_venv\Lib\site-packages\certifi\cacert.pem
  • Non-Admin installs: C:\Users\{USERNAME}\AppData\Roaming\Alteryx\Tools\TOOLNAME_vX.x.x_venv\Lib\site-packages\certifi\cacert.pem

 

Hope this helps. If it does, please like this post and mark it as a solution.

grazitti_sapna
17 - Castor

@mmurph200 , May be its some access issue. Try running it in administrator mode and also check if you have all the access as per others.

 

grazitti_sapna_0-1670910475694.png

 

Sapna Gupta
mmurph200
7 - Meteor

Tried running it as an admin no luck

PanPP
Alteryx Alumni (Retired)

Hi @mmurph200 

 

Is there a endpoint you are hitting for the OCR Tool?

 

Can you navigate to this location in a browser? 

 

Inside the browser, there should be an SSL cert associated with the endpoint.

 

 

Can you follow these steps here : 

 

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Connection-Errors-with-Python-based...

 

 

Modify the cacert.pem files depending on which install you have:

 

  • Admin installs: C:\ProgramData\Alteryx\Tools\TOOLNAME_vX.x.x_venv\Lib\site-packages\certifi\cacert.pem
  • Non-Admin installs: C:\Users\{USERNAME}\AppData\Roaming\Alteryx\Tools\TOOLNAME_vX.x.x_venv\Lib\site-packages\certifi\cacert.pem

 

 

Hope this helps. If it does, please like the post and mark it as a solution.

cristian_pisoni
5 - Atom

Hi,

 

create file pip.ini into <%appdata%\pip\> (if pip doesn't exist in %appdata%, create it) with the following content in it:

cristian_pisoni_0-1677775744582.png

 

 

this resolved the SSL cert issue I had.

 

Labels
Top Solution Authors