今天安装gevent时出现 ERROR: Command errored out with exit status 1,后面还有一堆错误,好像是说“文件”、setup啊之类的,我在网上花了两小时查了很多方法(例如:升级pip、升级setuptool,然而并没用,难受),最后终于找到一个解决我问题的办法。
1、进入https://www.lfd.uci.edu/~gohlke/pythonlibs/,该网址按照首字母排序,找到自己对应的版本下载下来(我是用的3.8,64位,即下面第一个):
Gevent: a coroutine-based networking library based on greenlet and libev.
Requires greenlet.
gevent‑1.5a2‑cp38‑cp38‑win_amd64.whl
gevent‑1.5a2‑cp38‑cp38‑win32.whl
2、下载对应的whl文件后,在cmd下进入whl所在的文件夹
C:\windows\system32>cd C:\Program Files\Python38\whl
3、最后再输入pip install gevent-1.5a2-cp38-cp38-win_amd64.whl进行安装就可以了。
C:\Program Files\Python38\whl>pip install gevent-1.5a2-cp38-cp38-win_amd64.whl
最后结果:
Processing c:\program files\python38\whl\gevent-1.5a2-cp38-cp38-win_amd64.whl
Requirement already satisfied: cffi>=1.12.2; platform_python_implementation == “CPython” and sys_platform == “win32” in c:\program files\python38\lib\site-packages (from gevent1.5a2) (1.14.0)
Requirement already satisfied: greenlet>=0.4.14; platform_python_implementation == “CPython” in c:\program files\python38\lib\site-packages (from gevent1.5a2) (0.4.15)
Requirement already satisfied: pycparser in c:\program files\python38\lib\site-packages (from cffi>=1.12.2; platform_python_implementation == “CPython” and sys_platform == “win32”->gevent==1.5a2) (2.20)
Installing collected packages: gevent
Successfully installed gevent-1.5a2
总结一下:其实就是下载一个安装包,然后用指令安装。不过在网上看了几个类似的指令操作,我都没成功(别人可能可以),只有这个我的成功了。希望可以对你有所帮助!欢迎交流讨论!
PS:不好的地方勿喷!谢谢!!!