Open Frefdt opened 1 year ago
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the "ssl’ module is compiled with ‘OpenSSL 1.1.0h 27 Mar 2018". See: https://github.com/urllib3/urllib3/issues/2168
TinyTuya uses the requests
library which uses urllib3
. It seems that v2 of urllib3 now requires OpenSSL 1.1.1 but your python environment has OpenSSL 1.1.0.
Workaround:
# remove urllib3 v2
pip uninstall urllib3
# install older version that support openssl v1.1.0
pip install urllib3==1.26.5
I need to research if there is a good way we can address this. Since urllib3's decision to remove support for OpenSSL < 1.1.1, many other projects are impacted due to the transitive dependencies in python modules.
Any suggestions or PRs appreciated. 😁
While it won't fix it, perhaps we should wrap that import in a try/except and print a message if it fails. That would at least allow local control to keep working.
Ooooh! That's a great idea. I wonder if this would work...
try:
import requests
except ImportError as impErr:
print("WARN: Unable to import requests library, Cloud functions will not work.")
print("WARN: Check dependencies. See https://github.com/jasonacox/tinytuya/issues/377")
print("WARN: Error: {}.".format(impErr.args[0]))
@Frefdt can you try this (just paste into a python prompt)? Also, what OS are you using?
Yeah, seems like it works! Currently running windows 10, but being that this was a fresh install of both python 3.7 and vscode its probably for the best if you wrap it in there for others that encounter similar problems
Also workaround worked just fine, thank you for the quick responses :)
Thanks @Frefdt !
@uzlonewolf I thought about folding this into #370 but don't want to conflate it - I think we make this a minor patch (v1.12.9).
Sounds like the best idea- just tested on a fresh vm and had the same issue so don't think it's an issue with my config specifically