0

I am using Heroku to deploy my Flask application.

Inside my application I am trying to import numpy. This works fine on my localhost, however when I deploy to Heroku the build never completes.

When I check my Heroku logs it is clear that it cannot find numpy.

I have tried putting numpy into my requirments.txt with different version numbers but none seems to work.

I've also tried adding a buildpack which includes numpy, following an example on like this: https://github.com/kennethreitz/conda-buildpack

On the official Heroku python build pack it says: "Some Python packages with obscure C dependencies (e.g. scipy) are not compatible"

Is it possible to import numpy somehow though?

2
  • Check the numpy dependencies, and include all of them in your requirements.txt as well? Commented Mar 15, 2016 at 10:42
  • Ah yea, I did not think to check the numpy dependencies... will look into that Commented Mar 15, 2016 at 10:54

1 Answer 1

1

I'm no expert on heroku, but installing numpy requires compiling of c dependencies and stuff like that. And to be able to do that, the system running your application needs dev packages. Such as python-dev.

In heroku docs is advice to use custom buildpacks to support obscure c dependencies. I've found this buildpack that should support numpy and scipy.

I hope this will work for you.

Cheers!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.