您的位置:首页 > 运维架构 > Linux

Linux安装autosub踩坑“ERROR: Package 'cachetools' requires a different Python: 2.7.13 not in '~= 3.5'

2020-04-05 12:16 2471 查看

今天心血来潮,想在Debian上安装

autosub
,项目地址:https://github.com/agermanidis/autosub
这是一个自动语音转文字的软件,基于python编写,以后有机会再介绍用法。

安装

autosub

pip install autosub

在安装过程中遇到问题,报错:

ERROR: Package 'cachetools' requires a different Python: 2.7.13 not in '~= 3.5'

意思是python版本应该是3.5左右而非2.7.13
这里我疑惑了很久,是因为我英语太差,把它理解成了需要2.7.13而不是3.5

踩坑过程,请勿轻易模仿

输入

pip -V
查看当前的python版本,得到:

pip 20.0.2 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

可见python版本确实过低。我确定已经安装了python3.5,默认路径在

/usr/bin/
,请首先确保你已经安装了新版的python

为新版python配置pip:
编辑文件

/usr/location/bin/pip
,第一行改为
#!/usr/bin/python3

如果该版本python未安装pip,执行:

wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py

再运行autosub安装命令果然没有报错了
但是!经判断,autosub是基于python2的项目,在python3.5下无法运行!
如果你也不幸踩到这个坑,先把已经安装的autosub卸载

正确解法

问题出现的原因是

cachetools
包更新至
4.0.0
,此版本不支持2.7。我们只需手动安装低版本
cachetools

查看

cachetools
包历史版本

pip install cachetools==?

出现信息:

Looking in indexes: https://mirrors.aliyun.com/pypi/simple
ERROR: Could not find a version that satisfies the requirement cachetools==? (from versions: 0.0.0, 0.1.0, 0.2.0, 0.3.0, 0.3.1, 0.4.0, 0.5.0, 0.5.1, 0.6.0, 0.7.0, 0.7.1, 0.8.0, 0.8.1, 0.8.2, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 2.0.0, 2.0.1, 2.1.0, 3.0.0, 3.1.0, 3.1.1, 4.0.0)
ERROR: No matching distribution found for cachetools==?

尝试安装

3.1.1

pip install cachetools==3.1.1

安装成功后,再运行安装

autosub
命令,程序成功安装并正常运行!

更新

受大佬@BingLingGroup指点,得知最新版的autosub支持python3,由于pip源更新慢于作者仓库,所以直接从github获取

运行以下命令执行安装即可

pip3 install git+https://github.com/agermanidis/autosub.git@master

问题最新进展 https://github.com/agermanidis/autosub/issues/171

交流讨论等具体内容请访问我的博客

原文地址:https://boyinthesun.cn/post/error-autosub/

  • 点赞
  • 收藏
  • 分享
  • 文章举报
BoyInTheSun 发布了16 篇原创文章 · 获赞 0 · 访问量 1330 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: