Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode decode error when put coverage into setup script in Windows #539

Open
nedbat opened this issue Dec 27, 2016 · 6 comments
Open

Unicode decode error when put coverage into setup script in Windows #539

nedbat opened this issue Dec 27, 2016 · 6 comments
Labels
bug Something isn't working windows

Comments

@nedbat
Copy link
Owner

nedbat commented Dec 27, 2016

Originally reported by Chen Huang (Bitbucket: chinux23, GitHub: chinux23)


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:

#!python

'''
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.


@nedbat
Copy link
Owner Author

nedbat commented Dec 27, 2016

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?

@nedbat
Copy link
Owner Author

nedbat commented Jun 20, 2017

Original comment by Félix Antoine Goudreault (Bitbucket: fgoudreault, GitHub: fgoudreault)


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 : pypa/setuptools#819

@nedbat
Copy link
Owner Author

nedbat commented Jun 20, 2017

@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?

@nedbat
Copy link
Owner Author

nedbat commented Jun 20, 2017

Original comment by Félix Antoine Goudreault (Bitbucket: fgoudreault, GitHub: fgoudreault)


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

#!python

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())

@nedbat
Copy link
Owner Author

nedbat commented Jun 20, 2017

@fgoudreault does "pip install -e ." work for you?

@nedbat
Copy link
Owner Author

nedbat commented Jun 20, 2017

Original comment by Félix Antoine Goudreault (Bitbucket: fgoudreault, GitHub: fgoudreault)


Yes, pip install -e seems to work.

@nedbat nedbat added major bug Something isn't working labels Jun 23, 2018
@nedbat nedbat removed the 4.2 label Aug 17, 2018
@nedbat nedbat added windows and removed major labels Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows
Projects
None yet
Development

No branches or pull requests

1 participant