pip: pip 19.1.1 fails to install pendulum 2.0.4

Environment

  • pip version: 19.1.1
  • Python version: 3.6.8
  • OS: Windows 10 Enterprise

Package Version


pip 19.1.1 setuptools 41.0.1

Description pip 19.1.1 / 19.0 fails to install pendulum 2.0.4. pip 18.1 works well.

No problem on Linux.

Expected behavior pendulum package is installed:

>pip install pendulum
Collecting pendulum
  Using cached https://files.pythonhosted.org/packages/5b/57/71fc910edcd937b72aa0ef51c8f5734fbd8c011fa1480fce881433847ec8/pendulum-2.0.4.tar.gz
  Installing build dependencies ... done
Collecting python-dateutil<3.0,>=2.6 (from pendulum)
  Using cached https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl
Collecting pytzdata>=2018.3 (from pendulum)
  Using cached https://files.pythonhosted.org/packages/a7/90/c9a148b4c98ccf88765ab7399debd38a33660109c9ba23706f560109b6e1/pytzdata-2019.1-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil<3.0,>=2.6->pendulum)
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, pytzdata, pendulum
  Running setup.py install for pendulum ... done
Successfully installed pendulum-2.0.4 python-dateutil-2.8.0 pytzdata-2019.1 six-1.12.0

How to Reproduce Open a cmd and run the following.

python -m venv test
call test\scripts\activate
python -m pip install -U pip
pip install pendulum

Output

>python -m venv test
>call test\scripts\activate
>python -m pip install -U pip  # updgrade to 19.1.1
Collecting pip
  Using cached https://files.pythonhosted.org/packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 18.1
    Uninstalling pip-18.1:
      Successfully uninstalled pip-18.1
Successfully installed pip-19.1.1
>pip install pendulum
Collecting pendulum
  Using cached https://files.pythonhosted.org/packages/5b/57/71fc910edcd937b72aa0ef51c8f5734fbd8c011fa1480fce881433847ec8/pendulum-2.0.4.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
ERROR: Exception:
Traceback (most recent call last):
  File "c:\users\shige\test\lib\site-packages\pip\_internal\cli\base_command.py", line 178, in main
    status = self.run(options, args)
  File "c:\users\shige\test\lib\site-packages\pip\_internal\commands\install.py", line 352, in run
    resolver.resolve(requirement_set)
  File "c:\users\shige\test\lib\site-packages\pip\_internal\resolve.py", line 131, in resolve
    self._resolve_one(requirement_set, req)
  File "c:\users\shige\test\lib\site-packages\pip\_internal\resolve.py", line 294, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "c:\users\shige\test\lib\site-packages\pip\_internal\resolve.py", line 242, in _get_abstract_dist_for
    self.require_hashes
  File "c:\users\shige\test\lib\site-packages\pip\_internal\operations\prepare.py", line 362, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "c:\users\shige\test\lib\site-packages\pip\_internal\operations\prepare.py", line 171, in prep_for_dist
    self.req.prepare_metadata()
  File "c:\users\shige\test\lib\site-packages\pip\_internal\req\req_install.py", line 553, in prepare_metadata
    metadata_name = canonicalize_name(self.metadata["Name"])
  File "c:\users\shige\test\lib\site-packages\pip\_internal\req\req_install.py", line 674, in metadata
    self._metadata = get_metadata(self.get_dist())
  File "c:\users\shige\test\lib\site-packages\pip\_internal\utils\packaging.py", line 48, in get_metadata
    metadata = dist.get_metadata('METADATA')
  File "c:\users\shige\test\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1420, in get_metadata
    return value.decode('utf-8') if six.PY3 else value
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 185: invalid continuation byte

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 17 (6 by maintainers)

Most upvoted comments

FYI, my setuptools PR that adds to the exception text the path to the problematic file has now been merged: https://github.com/pypa/setuptools/pull/1791

FYI, yesterday I posted the following PR to setuptools which would improve the UnicodeDecodeError seen in pip: https://github.com/pypa/setuptools/pull/1791 It would cause the path to the errant metadata file to be included in the error message text. That way it will be easier in the future to track down what package / tool is causing the error.

Yes, that works. But it’s a bit uncomfortable if you don’t normally use Anaconda. I mean, Anaconda is great. No question about it. Especially on Windows. So it’s a valid workaround. Still it’s a bug that should be fixed.

@chrahunt I put “awaiting response” since I was waiting for a reply to this question in my comment:

Can you try the install command with verbose logging?

It would provide more info to help diagnose the root cause.