warning警告問題解決1


warning警告問題, 這時可以不去管它, 但如果想解決, 可以這樣做:

c:\python\lib\site-packages\locust\core.py:17: 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 (c:\\python\\lib\\site-packages\\urllib3\\util\\__init__.py)', 'urllib3.contrib.pyopenssl (c:\\python\\lib\\site-packages\\urllib3\\contrib\\pyopenssl.py)'].
monkey.patch_all()

1、找到相應的路徑下的文件:

 

 2、添加以下三行代碼

import gevent
from gevent import monkey
monkey.patch_all()

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM