最近想學習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.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
解決方法,我認為有兩個:
一是、根據提示去安裝Microsoft Visual C++ 14.0,但是這個方法消耗的時間和空間都非常的高,大家可以量力而行;
第二種方法就是安裝最新(發布前)的locust,
pip install -U setuptools
pip install -U --pre locustio
- 1
- 2
安裝成功