为什么通过pip3安装任何软件包时,会发生configparser.InterpolationSyntaxError错误?

时间:2019-10-02 20:07:55

标签: python pip

当我通过pip3 for python 3.7.4安装任何软件包时,会出现以下错误:

Exception:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 179, in main
    status = self.run(options, args)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 393, in run
    use_user_site=options.use_user_site,
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/req/__init__.py", line 57, in install_given_reqs
    **kwargs
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 913, in install
    use_user_site=use_user_site, pycompile=pycompile,
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 445, in move_wheel_files
    warn_script_location=warn_script_location,
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/wheel.py", line 320, in move_wheel_files
    prefix=prefix,
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/locations.py", line 166, in distutils_scheme
    d.parse_config_files()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 413, in parse_config_files
    val = parser.get(section,opt)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 799, in get
    d)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 394, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 444, in _interpolate_some
    "found: %r" % (rest,))
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%Y-%m-%d %H:%M:%S'

我以前没有这个。最近出现了这个问题。该问题发生在OS X Mojave版本10.14.6

1 个答案:

答案 0 :(得分:0)

检查当前工作目录中的setup.cfg文件,其中包含不受支持的语法。

这是我于2018年4月创建的未解决问题#5182 CLI parses unrelated config files and then crashes

作为解决此问题之前的解决方法,您可以cd进入另一个目录,然后尝试再次安装。