Rodolfo Oocampo
Rodolfo Oocampo

Reputation: 79

How do you install Python packages in Heroku without using pip?

I am deploying an app on Heroku. When I deploy it, a dependency is missing. I am not able to install it via PIP, since the PIP installation is buggy. How can I get this dependency into Heroku?

Upvotes: 3

Views: 1957

Answers (1)

Chris
Chris

Reputation: 137129

You can't manually install Python libraries (or anything else) on Heroku after deploying. That's because Heroku's filesystem is ephemeral: any changes you make to it will be lost whenever your dyno restarts, which happens frequently (at least once per day).

Instead, make sure to define your dependencies properly in a requirements.txt file (or, if you prefer to use pipenv, in Pipfile and Pipfile.lock files). These files should be committed to your repository. When you deploy to Heroku it will install dependencies for you and include them in your application slug.

Upvotes: 2

Related Questions