Forums

Web app not deploying... don't know why!

I'm a new user and I'm trying to deploy a web app that works correctly on my local machine. I've followed the instructions for deploying a Django app, but here's what I get when I go to my URL:

Something went wrong :-(
Something went wrong while trying to load this website; please try again later.
If it is your site, you should check your logs to determine what the problem is.
There was an error loading your PythonAnywhere-hosted site. There may be a bug in your code.
Error code: Unhandled Exception

Here's my most recent error in the error log:

2023-06-28 01:04:03,295: ModuleNotFoundError: No module named 'pandas'

However, pandas seems to be installed. When I went into the virtual environment and did "pip freeze", I got:

numpy==1.25.0
pandas==2.0.2
python-dateutil==2.8.2
pytz==2023.3
six==1.16.0
tzdata==2023.3

No idea what I'm doing wrong, would love any help! Thanks!

Is your webapp also running in the same virtualenv? There's a virtualenv section in the webapp tab

I apologize, but I'm not sure what you mean. As far as I'm aware, the webapp is supposed to run at the URL I've been provided (https://halphillips.pythonanywhere.com/). I don't know what it would mean for the webapp to also be running in the same virtualenv.

Take a look at https://help.pythonanywhere.com/pages/Virtualenvs

Thanks. I've made it a few more steps-- had accidentally set up two virtual environments and have since deleted the wrong one-- and then had to install pandas. Got a "disk quota exceeded" error, deleted some stuff, tried installing pandas again, and it seemed to work... but now I get this error message in my error log:

ModuleNotFoundError: No module named 'pandas.util'

So I guess pandas DIDN'T install correctly. No idea how to fix that!

It looks like we have an ongoing email conversation about this too; perhaps it's best to continue there -- and then if you feel like posting an update here once we've got it fixed, that might help others in the future :-)

Sounds good!

Just throwing out there for the sake of others in the future that I had a very large virtual environment folder that I think was a holdover from when I deployed the web app locally. Hadn't realized it wasn't part of what I needed to upload. Deleted it and now THIS part of the problem is solved! (Still having other problems, but we're dealing with that in email!)

Thanks for the update!