Skip to content

Installation fails on some systems #66

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

Closed
nat-n opened this issue May 25, 2020 · 1 comment · Fixed by #67
Closed

Installation fails on some systems #66

nat-n opened this issue May 25, 2020 · 1 comment · Fixed by #67
Labels
bug Something isn't working

Comments

@nat-n
Copy link
Collaborator

nat-n commented May 25, 2020

I'm a bit baffled about the root cause, but I have simple reproduction steps and a simple fix.

The issue can be reproduced by running this Dockerfile:

FROM centos:7.5.1804
RUN yum update -y && yum install -y python3
RUN python3 -m pip install --upgrade pip
CMD ["python3", "-m", "pip", "install", "betterproto"]

like: docker run --rm -it $(docker build -q .)

Will produce output like:

Collecting betterproto
  Downloading betterproto-1.2.3.tar.gz (24 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmptildjr2u
       cwd: /tmp/pip-install-tgfsl0y5/betterproto
  Complete output (20 lines):
  Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
      main()
    File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-eqgnnb9a/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 148, in get_requires_for_build_wheel
      config_settings, requirements=['wheel'])
    File "/tmp/pip-build-env-eqgnnb9a/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 128, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-eqgnnb9a/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 250, in run_setup
      self).run_setup(setup_script=setup_script)
    File "/tmp/pip-build-env-eqgnnb9a/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 143, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 7, in <module>
      long_description=open("README.md", "r").read(),
    File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
      return codecs.ascii_decode(input, self.errors)[0]
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 11237: ordinal not in range(128)

The issue is that the setup.py reads the README, apparently in ascii mode instead of utf-8 even though it's python 3.6.8 (which doesn't behave this one on macOS for example), and seems to find some non-ascii characters. It's not obvious exactly what's wrong with the readme, but the setup.py if easily fixed by updating line 7 to to force utf-8 like:

long_description=open("README.md", "r", encoding="utf-8").read(),
nat-n added a commit that referenced this issue May 25, 2020
Fixes failing installation issue #66
@boukeversteegh
Copy link
Collaborator

It is the Copyright symbol at the end of the page. But let's keep it in utf-8. Good fix!

@boukeversteegh boukeversteegh added the bug Something isn't working label May 25, 2020
@boukeversteegh boukeversteegh linked a pull request May 25, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants