近期做的项目需要安装cython_bbox包,但当我纯真无邪的输入pip install cython_bbox筹备满心欢喜的等待安装成功却发现...,它显示错误了,这是一个从未见过的、很长的显示错误,它长这个样子:

我震撼了!这是个什么子?辗转反侧,不可以眠的我,纯真无邪的又加上了中科大源加速,发现并非速度问题,依然不出意料之外的失败了,可是网上的课程就是这么装的呀?我一直不明所以,直到有一天在github上才探寻到了答案,所以这篇文章,正是为了推荐这一次踩坑的历程,帮助大伙跳过我悲惨的历程。
正确安装教程1、安装cythoncython很容易安装:
pipinstallcython
太慢了?加速安装!
pipinstallcython-ihttps://pypi.mirrors.ustc.edu.cn/simple2、安装cython_bbox
这是一条很珍贵的命令,找了好久才找到的:(有时运行该命令一次便可以安装成功,有时要运行好几次,这可能和互联网有关。)
pipinstall-egit+https://github.com/samson-wang/cython_bbox.git#egg=cython-bbox3、 安装pycocotools
安装pycocotools是由于这个包常常与cython_bbox合作用,也就是讲:安装了cython_bbox,那样安装pycocotools已经是一种很容易见到的配套安装。
pipinstallpycocotools
太慢了?加速安装
pipinstallpycocotools-ihttps://pypi.mirrors.ustc.edu.cn/simple
完毕!
附:安装cython_bbox显示错误解决方法:Preparing metadata (setup.py) ... error error: subprocess-exited-with-error显示错误内容如下图所示:

Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
times; python setup.py egg_info did not run successfully.
│ exit code: 1
╰─ [6 lines of output]
Traceback (most recent call last):
File string, line 2, in module
File pip-setuptools-caller, line 34, in module
File /tmp/pip-install-a509pn1e/cython-bbox_4f8cde4aec364123b4ba34e507b2a155/setup.py, line 10, in module
from Cython.Build import cythonize
ModuleNotFoundError: No module named Cython
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
times; Encountered error while generating package metadata.
╰─ See above for output.
解决方法:
先安装Cpython然后再安装cython_bbox
pipinstallCythonpipinstallcython_bbox

注意在ubuntu系统下去安装,在windows系统上我尝试了还是安装不成功,还没有发现怎么办,假如有成功办法的可评论区留言。





