hiDaDeng / shreport

上海证券交易所上市公司定期报告下载,项目地址
MIT License
83 stars 28 forks source link

shreport无法编译 - MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. #4

Open zoewent opened 5 months ago

zoewent commented 5 months ago

只有import就会报错, from shreport import SH 具体报错信息:

/usr/local/bin/python3 /Users/xxxxxxx/Downloads/shreportcompanies.py /usr/local/lib/python3.11/site-packages/grequests.py:22: MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. It may also silently lead to incorrect behaviour on Python 3.7. Please monkey-patch earlier. See https://github.com/gevent/gevent/issues/1016. Modules that had direct imports (NOT patched): ['urllib3.util.ssl (/usr/local/lib/python3.11/site-packages/urllib3/util/ssl_.py)', 'urllib3.util (/usr/local/lib/python3.11/site-packages/urllib3/util/init.py)']. curious_george.patch_all(thread=False, select=False)

报错信息中已提供解决方法,具体见https://github.com/gevent/gevent/issues/1016