Locust安装失败:Running setup.py install for geventhttpclient ... error

最近想学习Locust性能测试,没想到卡在了安装上。
根据官方指导文档,执行pip install locust,报错信息如下所示:

Downloading MarkupSafe-1.1.1-cp36-cp36m-win32.whl (15 kB)
Using legacy setup.py install for ConfigArgParse, since package 'wheel' is not installed.
Using legacy setup.py install for geventhttpclient, since package 'wheel' is not installed.
Using legacy setup.py install for Flask-BasicAuth, since package 'wheel' is not installed.
Installing collected packages: ConfigArgParse, psutil, pyzmq, zope.interface, greenlet, pycparser, cffi, zope.event, gevent, msgpack, MarkupSafe, Jinja2, click, Werkzeug, itsdangerous, flask, geventhttpclient, Flask-BasicAuth, locust
    Running setup.py install for ConfigArgParse ... done
    Running setup.py install for geventhttpclient ... error
    ERROR: Command errored out with exit status 1:
     command: 'e:\program files (x86)\python3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\DT-040~1\\AppData\\Local\\Temp\\pip-install-a47vuh1v\\geventhttpclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\DT-040~1\\AppData\\Local\\Temp\\pip-install-a47vuh1v\\geventhttpclient\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\DT-040~1\AppData\Local\Temp\pip-record-md_9zmwq\install-record.txt' --single-version-externally-managed --compile --install-headers 'e:\program files (x86)\python3\Include\geventhttpclient'
         cwd: C:\Users\DT-040~1\AppData\Local\Temp\pip-install-a47vuh1v\geventhttpclient\
    Complete output (28 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.6
    creating build\lib.win32-3.6\geventhttpclient
    copying src\geventhttpclient\client.py -> build\lib.win32-3.6\geventhttpclient
    copying src\geventhttpclient\connectionpool.py -> build\lib.win32-3.6\geventhttpclient
    copying src\geventhttpclient\header.py -> build\lib.win32-3.6\geventhttpclient
    copying src\geventhttpclient\httplib.py -> build\lib.win32-3.6\geventhttpclient
    copying src\geventhttpclient\response.py -> build\lib.win32-3.6\geventhttpclient
    copying src\geventhttpclient\url.py -> build\lib.win32-3.6\geventhttpclient
    copying src\geventhttpclient\useragent.py -> build\lib.win32-3.6\geventhttpclient
    copying src\geventhttpclient\__init__.py -> build\lib.win32-3.6\geventhttpclient
    running egg_info
    writing src\geventhttpclient.egg-info\PKG-INFO
    writing dependency_links to src\geventhttpclient.egg-info\dependency_links.txt
    writing requirements to src\geventhttpclient.egg-info\requires.txt
    writing top-level names to src\geventhttpclient.egg-info\top_level.txt
    reading manifest file 'src\geventhttpclient.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no files found matching 'CHANGELOG'
    writing manifest file 'src\geventhttpclient.egg-info\SOURCES.txt'
    running build_ext
    building 'geventhttpclient._parser' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'e:\program files (x86)\python3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\DT-040~1\\AppData\\Local\\Temp\\pip-install-a47vuh1v\\geventhttpclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\DT-040~1\\AppData\\Local\\Temp\\pip-install-a47vuh1v\\geventhttpclient\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\DT-040~1\AppData\Local\Temp\pip-record-md_9zmwq\install-record.txt' --single-version-externally-managed --compile --install-headers 'e:\program files (x86)\python3\Include\geventhttpclient' Check the logs for full command output.

解决方法,我认为有两个:
一是、根据提示去安装Microsoft Visual C++ 14.0,但是这个方法消耗的时间和空间都非常的高,大家可以量力而行;
第二种方法就是安装最新(发布前)的locust,

pip install -U setuptools
pip install -U --pre locustio

安装成功
在这里插入图片描述

你可能感兴趣的:(性能测试)