Can I use Python packages such as numpy in DO Functions?

I tried to create a Function that uses numpy, so I started the code with “import numpy”. But, I got an error saying that there is no such package. Is it possible to use numpy, or other scientific Python libraries, in Functions?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Matt Welke
DigitalOcean Employee
DigitalOcean Employee badge
May 17, 2023

With our recently-released Python 3.11 runtime, we have included this package as well as a few others.

For packages not provided by the runtime, you can follow these steps to provide them alongside your deployed function code, as long as the total deployed function code does not exceed 48 MB.

Matt Welke
DigitalOcean Employee
DigitalOcean Employee badge
March 21, 2023

This comment has been deleted

    Try DigitalOcean for free

    Click below to sign up and get $200 of credit to try our products over 60 days!

    Sign up