How Do You Troubleshoot Messages about a markupsafe Fatal Error, C Extension Not Being Compiled, And/Or a Syntax Error with async when You Are Trying to Build a Docker Image?

Problem scenario
You wrote a Dockerfile. You are using it to try to create a Docker image. When you run the "docker build" command you get some error messages. The errors include one or more of the following:

1) A MarkupSafe fatal error related to Python.h.
2) A C extension not being compiled.
3) An invalid syntax error related to async (e.g., Jinja2/jinja2/asyncfilters.py").

You need to base the image off Ubuntu. What should you do?

Solution

  1. Make sure the Dockerfile uses "ubuntu:latest" and not "ubuntu:14.04"
  2. Make sure the Dockerfile installs python3 (not regular python).

Leave a comment

Your email address will not be published. Required fields are marked *