Unicode decode error when put coverage into setup script in Windows

Issue #539 closed
Chen Huang created an issue

I am using Windows 10 with Anaconda 64 bit python 3.5. It seems I can't put coverage as part of a requirement in any setup scripts.

For example, running the following setup script will fail:

Copyright (c) 2016 Test. All rights reserved.
from setuptools import setup

Installed c:\users\chen\anaconda3\lib\site-packages\testpackage-1.0-py3.5.egg
Processing dependencies for testpackage==1.0
Searching for coverage==4.2
Best match: coverage 4.2
Processing coverage-4.2-py3.5-win-amd64.egg
coverage 4.2 is already the active version in easy-install.pth
Installing coverage-3.5-script.py script to C:\Users\Chen\Anaconda3\Scripts
Traceback (most recent call last):
  File "setup2.py", line 17, in <module>
  File "C:\Users\Chen\Anaconda3\lib\distutils\core.py", line 148, in setup
  File "C:\Users\Chen\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
  File "C:\Users\Chen\Anaconda3\lib\distutils\dist.py", line 974, in run_command
  File "C:\Users\Chen\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\install.py", line 67, in run
  File "C:\Users\Chen\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\install.py", line 117, in do_egg_install
  File "C:\Users\Chen\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\easy_install.py", line 409, in run
  File "C:\Users\Chen\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\easy_install.py", line 645, in easy_install
  File "C:\Users\Chen\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\easy_install.py", line 696, in install_item
  File "C:\Users\Chen\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\easy_install.py", line 751, in process_distribution
  File "C:\Users\Chen\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\easy_install.py", line 664, in easy_install
  File "C:\Users\Chen\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\easy_install.py", line 699, in install_item
  File "C:\Users\Chen\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\easy_install.py", line 721, in process_distribution
  File "C:\Users\Chen\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\setuptools\command\easy_install.py", line 599, in install_egg_scripts
  File "C:\Users\Chen\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\pkg_resources\__init__.py", line 1469, in get_metadata
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x90 in position 2: invalid start byte

Any thoughts?

By revmoing "coverage" in the setup script, the install script pass.

Comments (8)

  1. Ned Batchelder repo owner

    Hmm, I have no idea why that would happen. I don't know where there's a 0x90 byte in the coverage.py metadata.

    Is there any way you could debug into pkg_resources__init__.py to see what it's looking at?

  2. Félix Antoine Goudreault

    I got the same error on windows 10 pro using Miniconda in a virtual env. conda version: 4.3.22 python version: 3.6.1

    Also, removing coverage in the install requires fixes the issue. Installing coverage through pip before calling the setup fixes the issue also. There is an issue on setuptools about that : https://github.com/pypa/setuptools/issues/819

  3. Ned Batchelder repo owner

    @fgoudreault thanks for the link to the pypa issue. I didn't know about that one. It mentions easy_install. Can you show the specific commands you are using to run the installation? @chinux23 What commands did you use to install?

  4. Félix Antoine Goudreault

    I used python setup.py develop where setup.py looks like:

    from setuptools import setup
    import versioneer
          install_requires=["nose", "pep8", "coverage", "openpyxl"],
  5. Log in to comment