When installing sendgrid on python 3.6.1 Ubuntu 16.04 in a docker image it throws this error.
Traceback (most recent call last):
File "setup4.py", line 10, in <module>
zip_safe=False
File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/usr/local/lib/python3.6/site-packages/setuptools/command/install.py", line 117, in do_egg_install
cmd.run()
File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 411, in run
self.easy_install(spec, not self.no_deps)
File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 653, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 700, in install_item
self.process_distribution(spec, dist, deps)
File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 745, in process_distribution
[requirement], self.local_index, self.easy_install
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 863, in resolve
replace_conflicting=replace_conflicting
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1141, in best_match
return self.obtain(req, installer)
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1153, in obtain
return installer(requirement)
File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 672, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 698, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 879, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1118, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1104, in run_setup
run_setup(setup_script, args)
File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 257, in run_setup
raise
File "/usr/local/lib/python3.6/contextlib.py", line 100, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 199, in setup_context
yield
File "/usr/local/lib/python3.6/contextlib.py", line 100, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 170, in save_modules
saved_exc.resume()
File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 145, in resume
six.reraise(type, exc, self._tb)
File "/usr/local/lib/python3.6/site-packages/pkg_resources/_vendor/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 158, in save_modules
yield saved
File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 199, in setup_context
yield
File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 254, in run_setup
_execfile(setup_script, ns)
File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 49, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-raqlxynh/sendgrid-5.2.0/setup.py", line 11, in <module>
File "/usr/local/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 192: ordinal not in range(128)
I have taken out all other packages. All other packages install without an issue.
from setuptools import setup, find_packages
setup(
name='sg_test',
packages=find_packages(),
install_requires=[
'sendgrid',
],
zip_safe=False
)
FROM ubuntu:16.04
RUN apt update
RUN apt install build-essential checkinstall -y
RUN apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev -y
RUN wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
RUN tar xvf Python-3.6.1.tar.xz
WORKDIR Python-3.6.1
RUN ./configure
RUN make
RUN make altinstall
RUN curl https://bootstrap.pypa.io/get-pip.py | python3.6
ADD setup.py /code/
WORKDIR /code
RUN python3.6 -m pip install -U pip
RUN python3.6 -m pip install -U setuptools
RUN python3.6 setup.py install
Issue Summary
When installing sendgrid on python 3.6.1 Ubuntu 16.04 in a docker image it throws this error.
I have taken out all other packages. All other packages install without an issue.
Steps to Reproduce
setup.pythat looks like this:I assume that this is to do with your
setup.pyI can take a look as well.Technical details: