Search code examples
pythonherokuplotly-dash

dash app dependencies for deployment on Heroku


I'm working on deploying my first dash app via heroku. I already did the example deployment given here: https://dash.plotly.com/deployment

which was quick and easy. Now I'm running through the same process with my own dash app, which is much more involved than the example app in the link, but which runs fine locally.

In step 2 given in the link, you initialize an empty git repo and run a new virtualenv, okay. Then you have to reinstall all the app's dependencies into the new virtual env.

This is my question, what are my app dependencies? Are those the modules I install at the top of my apps .py file? such as pandas, numpy, sklearn, etc?


Solution

  • Yes, that's correct. They must be defined in the requirements.txt file in the root of your project.

    You can create the file manually or running this command

     pip freeze > requirements.txt
    

    The file looks something like this

    pandas==1.2.0
    numpy==1.19.4