nk9 / get_dropbox_link

Code to get the URL of a file in the Dropbox folder
MIT License
6 stars 1 forks source link

ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+ #6

Closed nk9 closed 1 year ago

nk9 commented 1 year ago

When I try to run the Python script on macOS 12.6.6 with Xcode 14.2 (Python 3.9), I get this error:

Traceback (most recent call last):
  File "/Users/nick/Projects/OSS/get_dropbox_link/get_dropbox_link.py", line 37, in <module>
    import dropbox
  File "/Users/nick/Library/Python/3.9/lib/python/site-packages/dropbox/__init__.py", line 3, in <module>
    from dropbox.dropbox_client import (  # noqa: F401 # pylint: disable=unused-import
  File "/Users/nick/Library/Python/3.9/lib/python/site-packages/dropbox/dropbox_client.py", line 18, in <module>
    import requests
  File "/Users/nick/Library/Python/3.9/lib/python/site-packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/Users/nick/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py", line 38, in <module>
    raise ImportError(
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with LibreSSL 2.8.3. See: https://github.com/urllib3/urllib3/issues/2168
nk9 commented 1 year ago

Looks like this is a conflict between the version os OpenSSL shipped with macOS 12 and urllib3. There's some diagnosis at this StackOverflow question, but the solution that worked for me was:

/usr/bin/python3 -m pip install urllib3==1.26.6