Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
93 views
in Technique[技术] by (71.8m points)

python - How to pip install "lru"?

I am trying to use a python deep learning module keras-audio to train from audio files (python 3.8.6, MacOS 10.14.6). However, after installing that module and trying to run an example I get the following error

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'

so I tried to install that package with

pip install lru

which created the following error:

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('"'"'
'"'"', '"'"'
'"'"');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.

Any idea how to fix this error?

question from:https://stackoverflow.com/questions/65868715/how-to-pip-install-lru

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...