You can try doing a few things to avoid this type of issues:
Make sure your requirements.txt is up to date.
You can try containerizing your application and run it using docker.
These approaches are specifically designed to resolve such issues.
Let me know if you need more help!