Python pip upgrade fails with configparser.InterpolationSyntaxError


(Brian Menges) #1

I’m attempting to upgrade pip, setuptools, and wheel in a fresh default python (python3) install using brew. I’ve cleared caches, re-installed countless times, and every time I get the following error:

$ pip3 install --upgrade pip setuptools wheel
Collecting pip
  Using cached pip-10.0.0-py2.py3-none-any.whl
Requirement already up-to-date: setuptools in /usr/local/lib/python3.6/site-packages
Collecting wheel
  Using cached wheel-0.31.0-py2.py3-none-any.whl
Installing collected packages: pip, wheel
  Found existing installation: pip 9.0.3
    Uninstalling pip-9.0.3:
      Successfully uninstalled pip-9.0.3
  Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python3.6/site-packages/pip/wheel.py", line 247, in move_wheel_files
    prefix=prefix,
  File "/usr/local/lib/python3.6/site-packages/pip/locations.py", line 141, in distutils_scheme
    d.parse_config_files()
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 402, in parse_config_files
    val = parser.get(section,opt)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/configparser.py", line 800, in get
    d)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/configparser.py", line 394, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/configparser.py", line 444, in _interpolate_some
    "found: %r" % (rest,))
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%{?dist}'
You are using pip version 9.0.3, however version 10.0.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

I can’t figure out how to resolve this – also of note, this prevents me from installing any wheel with the same error message about configparser.


(Brian Menges) #2

seems it might be related to being in a path other than my home directory. I’m using zsh and yadr… and when i reset my shell and go to my HOME directory, I can install python3 modules… is yadr incompatible with python3 ?