我正在使用 docker 支持的 lambdas 和 AWS 为 python3.8 提供的基本映像。
看起来它试图从头开始构建 matplotlib,然后因 gcc 相关错误而失败。
复制很简单,只需尝试构建以下 Dockerfile:
FROM amazon/aws-lambda-python:3.8
RUN yum -y install gcc
RUN pip3 install --upgrade pip
RUN pip3 install matplotlib
错误:
#7 13.82 set build/lib.linux-x86_64-3.8/matplotlib/_version.py to '3.4.3'
#7 13.82 running build_ext
#7 13.82 creating tmp
#7 13.82 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/var/lang/include/python3.8 -c /tmp/tmpjr1hj4f1.cpp -o tmp/tmpjr1hj4f1.o -fvisibility=hidden
#7 13.82 gcc: error trying to exec 'cc1plus': execvp: No such file or directory
#7 13.82 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/var/lang/include/python3.8 -c /tmp/tmp74f416b5.cpp -o tmp/tmp74f416b5.o -fvisibility-inlines-hidden
#7 13.82 gcc: error trying to exec 'cc1plus': execvp: No such file or directory
#7 13.82 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/var/lang/include/python3.8 -c /tmp/tmp19pyjmxw.cpp -o tmp/tmp19pyjmxw.o -flto
#7 13.82 gcc: error trying to exec 'cc1plus': execvp: No such file or directory
#7 13.82 Extracting /project/freetype/freetype2/2.6.1/freetype-2.6.1.tar.gz
#7 13.82 Building freetype in build/freetype-2.6.1
#7 13.82 GNU make (>= 3.80) or makepp (>= 1.19) is required to build FreeType2.
#7 13.82 Please try
#7 13.82
#7 13.82 MAKE=<GNU make command name> ./configure
#7 13.82
#7 13.82 or
#7 13.82
#7 13.82 MAKE="makepp --norc-substitution" ./configure
#7 13.82 Traceback (most recent call last):
#7 13.82 File "<string>", line 1, in <module>
#7 13.82 File "/tmp/pip-install-v3njpp10/matplotlib_5bf0432199ce40b5a487eafc6a513cc3/setup.py", line 258, in <module>
#7 13.82 setup( # Finally, pass this all along to distutils to do the heavy lifting.
#7 13.82 File "/var/lang/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
#7 13.82 return distutils.core.setup(**attrs)
#7 13.82 File "/var/lang/lib/python3.8/distutils/core.py", line 148, in setup
#7 13.82 dist.run_commands()
#7 13.82 File "/var/lang/lib/python3.8/distutils/dist.py", line 966, in run_commands
#7 13.82 self.run_command(cmd)
#7 13.82 File "/var/lang/lib/python3.8/distutils/dist.py", line 985, in run_command
#7 13.82 cmd_obj.run()
#7 13.82 File "/var/lang/lib/python3.8/site-packages/setuptools/command/install.py", line 61, in run
#7 13.82 return orig.install.run(self)
#7 13.82 File "/var/lang/lib/python3.8/distutils/command/install.py", line 545, in run
#7 13.82 self.run_command('build')
#7 13.82 File "/var/lang/lib/python3.8/distutils/cmd.py", line 313, in run_command
#7 13.82 self.distribution.run_command(command)
#7 13.82 File "/var/lang/lib/python3.8/distutils/dist.py", line 985, in run_command
#7 13.82 cmd_obj.run()
#7 13.82 File "/var/lang/lib/python3.8/distutils/command/build.py", line 135, in run
#7 13.82 self.run_command(cmd_name)
#7 13.82 File "/var/lang/lib/python3.8/distutils/cmd.py", line 313, in run_command
#7 13.82 self.distribution.run_command(command)
#7 13.82 File "/var/lang/lib/python3.8/distutils/dist.py", line 985, in run_command
#7 13.82 cmd_obj.run()
#7 13.82 File "/var/lang/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 79, in run
#7 13.82 _build_ext.run(self)
#7 13.82 File "/var/lang/lib/python3.8/distutils/command/build_ext.py", line 340, in run
#7 13.82 self.build_extensions()
#7 13.82 File "/tmp/pip-install-v3njpp10/matplotlib_5bf0432199ce40b5a487eafc6a513cc3/setup.py", line 199, in build_extensions
#7 13.82 package.do_custom_build(env)
#7 13.82 File "/tmp/pip-install-v3njpp10/matplotlib_5bf0432199ce40b5a487eafc6a513cc3/setupext.py", line 596, in do_custom_build
#7 13.82 subprocess.check_call(
#7 13.82 File "/var/lang/lib/python3.8/subprocess.py", line 364, in check_call
#7 13.82 raise CalledProcessError(retcode, cmd)
#7 13.82 subprocess.CalledProcessError: Command '['./configure', '--with-zlib=no', '--with-bzip2=no', '--with-png=no', '--with-harfbuzz=no', '--enable-static', '--disable-shared']' returned non-zero exit status 1.
#7 13.82 ----------------------------------------
#7 13.83 ERROR: Command errored out with exit status 1: /var/lang/bin/python3.8 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v3njpp10/matplotlib_5bf0432199ce40b5a487eafc6a513cc3/setup.py'"'"'; __file__='"'"'/tmp/pip-install-v3njpp10/matplotlib_5bf0432199ce40b5a487eafc6a513cc3/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-vdv6xdpv/install-record.txt --single-version-externally-managed --compile --install-headers /var/lang/include/python3.8/matplotlib Check the logs for full command output.