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()