当前位置: 代码迷 >> 综合 >> Locust安装失败: ‘locustio‘ to ‘locust‘
  详细解决方案

Locust安装失败: ‘locustio‘ to ‘locust‘

热度:30   发布时间:2024-02-11 13:29:44.0

 

根据官方指导文档,执行pip install locust,报错信息如下所示:

C:\Users\Administrator>pip install locustio
Collecting locustio
Downloading locustio-0.999.tar.gz (267 kB)
|████████████████████████████████| 267 kB 159 kB/s
Using legacy 'setup.py install' for locustio, since package 'wheel' is not installed.
Installing collected packages: locustio
Running setup.py install for locustio ... error
ERROR: Command errored out with exit status 1:
command: 'd:\devtools\python36\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-47r1anz2\\locustio\\setup.py'"'"'; __file__='"'"'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-47r1anz2\\locustio\\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\ADMINI~1\AppData\Local\Temp\pip-record-zcs0bc3l\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\devtools\python36\Include\locustio'
cwd: C:\Users\ADMINI~1\AppData\Local\Temp\pip-install-47r1anz2\locustio\
Complete output (4 lines):
running install

    **** Locust package has moved from 'locustio' to 'locust'. Please update your reference (or pin your version to 0.14.6 if you dont want to update to 1.0) ****

 

 

  ----------------------------------------
ERROR: Command errored out with exit status 1: 'd:\devtools\python36\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-47r1anz2\\locustio\\setup.py'"'"'; __file__='"'"'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-47r1anz2\\locustio\\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\ADMINI~1\AppData\Local\Temp\pip-record-zcs0bc3l\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\devtools\python36\Include\locustio' Check the logs for full command output.

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

安装成功