"urllib3 v2.0 only support OpenSSL 1.1.1+"?

Running python on macOS 10.13.6. I get this error.


I am looking for a way to proceed. Do I start with macOS? Should I try python? The same code works in a parallels vm running macOS High Sierra. I think I'll re-install python.


python3 firstRequestFedTrimmed.py

Traceback (most recent call last):
  File "firstRequestFedTrimmed.py", line 9, in <module>
    import requests
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/__init__.py", line 42, in <module>
    "urllib3 v2.0 only supports OpenSSL 1.1.1+, currently "
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.1.0j  20 Nov 2018'. See: https://github.chttps://github.com/urllib3/urllib3/issues/2168


irstRequestFedTrimmed.py:


#
# the video:
#    https://www.youtube.com/watch?v=y_vAx26I5yo
#
# Code from the youtube video
# although, link to code didn't exactly work

# an alternative
# https://maxtan.co/html_form

import requests

# fcc
url = 'https://wireless2.fcc.gov/UlsApp/AsrSearch/asrRegistrationSearch.jsp'

fiLatDir="N"

payload = {"fiLatDir":fiLatDir}

print("payload is ", payload)

try:
    r = requests.post(url, data=payload)
except requests.exceptions.RequestException as e:  # This is the correct syntax
    print("==========> Error in Requests is ", e)
    raise SystemExit(e)    # <------------------------------ bye ------

print("r.text is ",r.text)
print("r.status_code is ", r.status_code)

f = opend("webPageQuery.txt", "w")
f.write(r.text)
f.close




Install python3 from

https://www.python.org/downloads/ 

pip3 install requests

Earlier Mac models

Posted on Jul 9, 2023 10:52 AM

Reply
2 replies

Jul 11, 2023 12:23 PM in response to rccharles

I suspect your installed versions are skewed.


Confirm you're running the same version of urllib3 and ssl modules in both places, and have the appropriate version of OpenSSL available.


Also see the error-referenced issue: https://github.com/urllib3/urllib3/issues/2168


If you scroll down in that issue, it appears the urllib3 is outdated: "It looks like this was resolved in 2.0.3." There's some further chatter there, but it appears loading a current Python3 (updating your installed Python) should resolve this.


Apple is moving away from installed scripting languages, so you'll want to follow that path eventually anyway.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

"urllib3 v2.0 only support OpenSSL 1.1.1+"?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.