没有找到 ConfigParser 模块

3

我正在尝试安装Port Audio,因为我的代码(使用pyaudio和speechrecognition)要求先构建并安装Port Audio绑定。无论如何,当我输入pip install port audio时,它会显示以下内容:

    ERROR: Command errored out with exit status 1:
     command: 'c:\users\stewa\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\stewa\\AppData\\Local\\Temp\\pip-install-nkbwpxww\\audio.coders\\setup.py'"'"'; __file__='"'"'C:\\Users\\stewa\\AppData\\Local\\Temp\\pip-install-nkbwpxww\\audio.coders\\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 'C:\Users\stewa\AppData\Local\Temp\pip-pip-egg-info-y8d_hj4c'
         cwd: C:\Users\stewa\AppData\Local\Temp\pip-install-nkbwpxww\audio.coders\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\stewa\AppData\Local\Temp\pip-install-nkbwpxww\audio.coders\setup.py", line 5, in <module>
        import ConfigParser
    ModuleNotFoundError: No module named 'ConfigParser'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我收到了“没有名为 ConfigParser 的模块”的错误提示,你知道我该怎么办吗?如果有帮助的话,我正在使用 Python 3.8.5 和 Windows 10。

谢谢。


我本来期望会有 from configparser import ConfigParser 这样的代码。 - undefined
这个回答解决了你的问题吗?Python 3 ImportError: No module named 'ConfigParser' - undefined
1个回答

7

该程序包很可能不兼容Python-3。

正如这个答案所述,ConfigParser 已在Python-3中更名为configparser。 您可以考虑通过Python-2运行它(不建议,因为已被弃用),或使用另一个已更新的软件包(如果有)。


@STEMguy24 你可以尝试下载它并在本地更改import语句(from configparser import Configparser),然后再执行pip install .但是谁知道还需要改变哪些其他东西才能使其与Python 3兼容...如果只是导入的问题,他们可能已经解决了。 - undefined

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接