Let’s see how we can add arbitrary packages for the Modal Function you defined in the previous section:

  1. Define a Modal Image that pip installs numpy
  2. Attach this Image to your App
  3. Import the library in your Function

Click Run to see it in action!


$ modal run custom_container.py