Unicode decode error when put coverage into setup script in Windows

Issue #539 new
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

setup(
    name='testpackage',
    version='1.0',
    description='test',
    author='test',
    author_email='',
    long_description="HelloWorld",
    license='BSD',
    classifiers=[],
    install_requires=[
        'pytz',
        'coverage'
    ],
)
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>
    'coverage'
  File "C:\Users\Chen\Anaconda3\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\Chen\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\Users\Chen\Anaconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  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 (7)

  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 used python setup.py develop where setup.py looks like:

    from setuptools import setup
    import versioneer
    
    setup(name="name",
          description="description",
          url="url",
          install_requires=["nose", "pep8", "coverage", "openpyxl"],
          version=versioneer.get_version(),
          cmdclass=versioneer.get_cmdclass())
    
  3. Log in to comment