0

I have a Flask app whose Python environment was created in Miniconda. Uploading the Flask app to AWS-EB in a zip file results in errors and Severe health. (Python 3.8 running 64bit Amazon Linux 2)

My eb-engine.log shows ERROR: Could not build wheels for cartopy, which is required to install pyproject.toml-based projects.

I have traced the problem to the requirements.txt and that fact that AWS-EB relies on pip to build the environment; one of my packages requires Cartopy, a library that pip has trouble installing (see here and here for background.)

My first approach is to tell AWS-EB to build my environment with Conda instead. This thread and this thread hint at a solution using a .config file in the .ebextensions folder to tell EB to download Anaconda, install it, and... then I am not sure. I can recreate the commands to install Conda, but I have found no .config examples that walk through a full list of commands to build a Conda environment and use it to launch the Flask app, circumventing AWS-EB's requirements.txt process.

Separately, a few SE threads mention a Cartopy-specific workaround involving pre-compiled wheels from Christolph Gohlke's page. This could also be a solution, but how to implement these steps when deploying to AWS-EB with a zip file and requirements.txt?

I have been relying on uploading zip files of my Flask app and supporting files via the AWS Console. I find the AWS and EB Command Line interfaces intimidating but would happily dive in if they could help solve this problem.

Thank you all.

davidism
  • 121,510
  • 29
  • 395
  • 339
shvpvg
  • 1
  • 1

0 Answers0