首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何通过pip安装"lru"?

如何通过pip安装"lru"?
EN

Stack Overflow用户
提问于 2021-01-24 17:01:13
回答 1查看 328关注 0票数 0

我正在尝试使用python深度学习模块keras-audio来训练音频文件(python 3.8.6,MacOS 10.14.6)。但是,在安装该模块并尝试运行示例后,我得到了以下错误

代码语言:javascript
复制
Traceback (most recent call last):
  File "demo/cifar10_train.py", line 1, in <module>
    from keras_audio.library.cifar10 import Cifar10AudioClassifier
  File "/Users/user/keras-audio/keras-audio/keras_audio/library/cifar10.py", line 2, in <module>
    from lru import LRU
ModuleNotFoundError: No module named 'lru'

因此,我尝试使用以下命令安装该软件包

代码语言:javascript
复制
pip install lru

这产生了以下错误:

代码语言:javascript
复制
Collecting lru
  Using cached lru-0.1.tar.gz (1.1 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/users/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/0g/wwq2q6nn35n8vmrwhw5qfk601zlkw_/T/pip-install-tohqsyc0/lru_e04682eaa31f4d3291305bac811979b4/setup.py'"'"'; __file__='"'"'/private/var/folders/0g/wwq2q6nn35n8vmrwhw5qfk601zlkw_/T/pip-install-tohqsyc0/lru_e04682eaa31f4d3291305bac811979b4/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/0g/wwq2q6nn35n8vmrwhw5qfk601zlkw_/T/pip-pip-egg-info-kv5i7tfq
         cwd: /private/var/folders/0g/wwq2q6nn35n8vmrwhw5qfk601zlkw_/T/pip-install-tohqsyc0/lru_e04682eaa31f4d3291305bac811979b4/
    Complete output (8 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/0g/wwq2q6nn35n8vmrwhw5qfk601zlkw_/T/pip-install-tohqsyc0/lru_e04682eaa31f4d3291305bac811979b4/setup.py", line 2, in <module>
        from lru import __version__ as version
      File "/private/var/folders/0g/wwq2q6nn35n8vmrwhw5qfk601zlkw_/T/pip-install-tohqsyc0/lru_e04682eaa31f4d3291305bac811979b4/lru.py", line 18
        raise KeyError, key
                      ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

你知道如何修复这个错误吗?

EN

回答 1

Stack Overflow用户

发布于 2021-07-29 22:47:53

也遇到了同样的问题,在安装了pip install libpython3.8-dev之后,它被修复了。对于不同版本的python,请安装相应的软件包,即pip install libpython3.6-dev

对于不同的操作系统,请参考this答案

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65868715

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档