Running Lab 3, Option 1 (Bring you own Container) after cloning the repo last night as part of an event, we encountered issued in the process of building the Docker container.
The reason for this seems to be that gevent doesn't find a suitable wheel file to use, and thus downloads and attempts to create the wheel from source. But the Dockerfile doesn't include any C compiler or python-dev
modules.
Overall, even though we could work around this issue by adding libraries such as build-essential
and python-dev
to Dockerfile, I believe the underlying problem is we're still using Python 2.7 for this Lab, which in time may start causing additional issues with other libraries
(...)
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
(...)
Collecting gevent
Downloading gevent-21.8.0.tar.gz (6.2 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'done'
(...)
Building wheels for collected packages: gevent
Building wheel for gevent (PEP 517): started
Building wheel for gevent (PEP 517): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/bin/python /usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpQHzSIn
cwd: /tmp/pip-install-OouyxP/gevent
Complete output (344 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/gevent
copying src/gevent/_monitor.py -> build/lib.linux-x86_64-2.7/gevent
(<Removing additional copying>)
copying src/gevent/testing/six.py -> build/lib.linux-x86_64-2.7/gevent/testing
creating build/lib.linux-x86_64-2.7/gevent/resolver
copying src/gevent/resolver/thread.py -> build/lib.linux-x86_64-2.7/gevent/resolver
copying src/gevent/resolver/_addresses.py -> build/lib.linux-x86_64-2.7/gevent/resolver
copying src/gevent/resolver/_hostsfile.py -> build/lib.linux-x86_64-2.7/gevent/resolver
copying src/gevent/resolver/__init__.py -> build/lib.linux-x86_64-2.7/gevent/resolver
copying src/gevent/resolver/blocking.py -> build/lib.linux-x86_64-2.7/gevent/resolver
copying src/gevent/resolver/ares.py -> build/lib.linux-x86_64-2.7/gevent/resolver
copying src/gevent/resolver/dnspython.py -> build/lib.linux-x86_64-2.7/gevent/resolver
creating build/lib.linux-x86_64-2.7/gevent/_ffi
copying src/gevent/_ffi/watcher.py -> build/lib.linux-x86_64-2.7/gevent/_ffi
copying src/gevent/_ffi/callback.py -> build/lib.linux-x86_64-2.7/gevent/_ffi
copying src/gevent/_ffi/__init__.py -> build/lib.linux-x86_64-2.7/gevent/_ffi
copying src/gevent/_ffi/loop.py -> build/lib.linux-x86_64-2.7/gevent/_ffi
creating build/lib.linux-x86_64-2.7/gevent/libev
copying src/gevent/libev/watcher.py -> build/lib.linux-x86_64-2.7/gevent/libev
copying src/gevent/libev/corecffi.py -> build/lib.linux-x86_64-2.7/gevent/libev
copying src/gevent/libev/__init__.py -> build/lib.linux-x86_64-2.7/gevent/libev
copying src/gevent/libev/_corecffi_build.py -> build/lib.linux-x86_64-2.7/gevent/libev
creating build/lib.linux-x86_64-2.7/gevent/libuv
copying src/gevent/libuv/watcher.py -> build/lib.linux-x86_64-2.7/gevent/libuv
copying src/gevent/libuv/__init__.py -> build/lib.linux-x86_64-2.7/gevent/libuv
copying src/gevent/libuv/_corecffi_build.py -> build/lib.linux-x86_64-2.7/gevent/libuv
copying src/gevent/libuv/loop.py -> build/lib.linux-x86_64-2.7/gevent/libuv
creating build/lib.linux-x86_64-2.7/gevent/tests/monkey_package
copying src/gevent/tests/monkey_package/issue1526_no_monkey.py -> build/lib.linux-x86_64-2.7/gevent/tests/monkey_package
(<Removing additional copying>)
copying src/gevent/tests/test_server.key -> build/lib.linux-x86_64-2.7/gevent/tests
creating build/lib.linux-x86_64-2.7/gevent/testing/coveragesite
copying src/gevent/testing/coveragesite/sitecustomize.py -> build/lib.linux-x86_64-2.7/gevent/testing/coveragesite
running build_ext
generating cffi module 'build/temp.linux-x86_64-2.7/gevent.libuv._corecffi.c'
creating build/temp.linux-x86_64-2.7
Running '(cd "/tmp/pip-install-OouyxP/gevent/deps/libev" && sh ./configure -C > configure-output.txt )' in /tmp/pip-install-OouyxP/gevent
configure: error: in `/tmp/pip-install-OouyxP/gevent/deps/libev':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
main()
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py", line 205, in build_wheel
metadata_directory)
File "/usr/local/lib/python2.7/dist-packages/setuptools/build_meta.py", line 209, in build_wheel
wheel_directory, config_settings)
File "/usr/local/lib/python2.7/dist-packages/setuptools/build_meta.py", line 194, in _build_with_temp_dir
self.run_setup()
File "/usr/local/lib/python2.7/dist-packages/setuptools/build_meta.py", line 243, in run_setup
self).run_setup(setup_script=setup_script)
File "/usr/local/lib/python2.7/dist-packages/setuptools/build_meta.py", line 142, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 481, in <module>
run_setup(EXT_MODULES)
File "setup.py", line 465, in run_setup
"signal_os_incompat = gevent.monkey:_subscribe_signal_os",
File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 162, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/lib/python2.7/dist-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
self.run_command(cmd_name)
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-99XjyX/overlay/lib/python2.7/site-packages/cffi/setuptools_ext.py", line 143, in run
ext.sources[0] = make_mod(self.build_temp, pre_run)
File "/tmp/pip-build-env-99XjyX/overlay/lib/python2.7/site-packages/cffi/setuptools_ext.py", line 128, in make_mod
pre_run(ext, ffi)
File "/tmp/pip-install-OouyxP/gevent/_setuputils.py", line 364, in pre_run
action()
File "/tmp/pip-install-OouyxP/gevent/_setuplibev.py", line 55, in configure_libev
system(libev_configure_command)
File "/tmp/pip-install-OouyxP/gevent/_setuputils.py", line 195, in system
if _system(cmd, cwd=cwd, env=env, **kwargs):
File "/tmp/pip-install-OouyxP/gevent/_setuputils.py", line 191, in _system
return check_call(cmd, cwd=cwd, env=env, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '(cd "/tmp/pip-install-OouyxP/gevent/deps/libev" && sh ./configure -C > configure-output.txt )' returned non-zero exit status 1
----------------------------------------
ERROR: Failed building wheel for gevent
Failed to build gevent
ERROR: Could not build wheels for gevent which use PEP 517 and cannot be installed directly
The command '/bin/sh -c wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && python get-pip.py && pip install numpy==1.16.2 scipy==1.2.1 scikit-learn==0.20.2 pandas flask gevent gunicorn && (cd /usr/local/lib/python2.7/dist-packages/scipy/.libs; rm *; ln ../../numpy/.libs/* .) && rm -rf /root/.cache' returned a non-zero code: 1