No Module Found When Deploying
teldridgeldn
TRIALOP

a year ago

I am deploying a streamlit app

It seems to crash after attempting to deploy for 5 minutes . The logs say the following /opt/venv/bin/python: No module named momentum_dashboard, however in my GitHub repo it is located src/momentum_dashboard.

Thoughts on how I can correct this?

Solved

1 Replies

Hey there Tom,

The error you're encountering is likely due to Python not being able to find the momentum_dashboard module because it's located in a subdirectory (src). To resolve this, you can adjust your PYTHONPATH to include the src directory. Here's how you can do it:

  1. Modify the PYTHONPATH: You can set the PYTHONPATH environment variable to include the src directory. This can be done in your deployment settings or by adding a .env file with the following content:

   PYTHONPATH=src
  1. Update your requirements.txt: Ensure that all dependencies are listed in your requirements.txt file and that it's included in your project root. We find that a lot of errors from users come from a malformed requirement.txt

Let me know if this works,
Angelo


Status changed to Awaiting User Response Railway about 1 year ago


Railway
BOT

7 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 7 months ago


Loading...