安装skimage出错的解决方法

在Ubuntu 16.04上安装skimage时遇到错误,由于matplotlib版本过低(3.0.0),导致安装失败。升级matplotlib到3.1及以上版本或降级到2.2.2可以解决问题。通过`pip uninstall matplotlib`卸载,再用`pip install matplotlib==2.2.2`安装低版本,接着运行`pip install scikit-image`成功安装skimage及其依赖。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

前言

今天在安装skimage的时候报出错误如下:

ERROR: Complete output from command python setup.py egg_info:
    ERROR: 
    Beginning with Matplotlib 3.1, Python 3.6 or above is required.
    
    This may be due to an out of date pip.
    
    Make sure you have pip >= 9.0.1.
    
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-rar9t7jd/matplotlib/

计算机配置

操作系统:ubuntu 16.04
python版本:3.5

解决方法

刚开始直接百度,给出的解决方案包括:升级pip,升级setupTools等,这些对我都没有帮助。然后就看见了这么一句话:

Beginning with Matplotlib 3.1, Python 3.6 or above is required.

刚开始光顾着去百度,竟然忽略了这么重要一句话,意思是:从matplotlib3.1开始,需要python3.6或者更高的版本。然后我就使用

pip list

查看matplotlib的版本,果然是3.0.0,所以就果断把这个版本给删除了:

pip uninstall matplotlib

重新安装一个低版本的matplotlib:

pip install matplotlib==2.2.2

然后再安装scikit-image包:

pip install scikit-image

这样就果断安装好了,顺便还安装上去了几个依赖包:

Successfully built networkx
Installing collected packages: networkx, PyWavelets, imageio, scikit-image
Successfully installed PyWavelets-1.0.3 imageio-2.5.0 networkx-2.3 scikit-image-0.15.0
Successfully built networkx
Installing collected packages: networkx, PyWavelets, imageio, scikit-image
Successfully installed PyWavelets-1.0.3 imageio-2.5.0 networkx-2.3 scikit-image-0.15.0

总结

以后一定要第一时间先去阅读错误提示,而不是直接去百度。切记~~~~

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值