Forums

ModuleNotFoundError

Hi, I'm trying to deploy my app. So I have an error "ModuleNotFoundError: No module named 'seaborn' " Well, no problem I think and install seaborn with a command pip3.6 install --user seaborn. And it's installed, I can import it. But the app doesn't work even after many reloads. It still gives me an error that no module named seaborn. How can I solve it?

Are you using the same Python version for the install and for the app?

Yeah, I checked it. The version is 3.6 for both of them

Are you sure that's the error that you're getting?

Sure. Also it works perfectly on my local server. 2017-11-22 22:08:48,096: Error running WSGI application 2017-11-22 22:08:48,099: ModuleNotFoundError: No module named 'seaborn' 2017-11-22 22:08:48,100: File "./app.py", line 7, in <module> 2017-11-22 22:08:48,100: import seaborn as sns

have you tried the debugging tips here? https://help.pythonanywhere.com/pages/DebuggingImportError

Well, I will try, but why it works on my local machine and does not here? Also I tried to run my app with virtual machine here on the site, but can't install all the libraries (it has 120mb of memory and it says that no space libre).

Your local machine is a different machine with a different environment.

Okay, I have no idea why it doesn't work

2017-11-22 22:08:48,096: Error running WSGI application
2017-11-22 22:08:48,099: ModuleNotFoundError: No module named 'seaborn'
2017-11-22 22:08:48,099:   File "/var/www/hexi_pythonanywhere_com_wsgi.py", line 16, in <module>
2017-11-22 22:08:48,099:     from app import app as application
2017-11-22 22:08:48,100: 
2017-11-22 22:08:48,100:   File "./app.py", line 7, in <module>
2017-11-22 22:08:48,100:     import seaborn as sns
2017-11-22 22:08:48,100: ***************************************************
2017-11-22 22:08:48,100: If you're seeing an import error and don't know why,
2017-11-22 22:08:48,100: we have a dedicated help page to help you debug: 
2017-11-22 22:08:48,100: https://help.pythonanywhere.com/pages/DebuggingImportError/
2017-11-22 22:08:48,101: ***************************************************
2017-11-22 22:08:50,504: Error running WSGI application
2017-11-22 22:08:50,505: ModuleNotFoundError: No module named 'seaborn'
2017-11-22 22:08:50,505:   File "/var/www/hexi_pythonanywhere_com_wsgi.py", line 16, in <module>
2017-11-22 22:08:50,505:     from app import app as application
2017-11-22 22:08:50,505: 
2017-11-22 22:08:50,505:   File "./app.py", line 7, in <module>

Those errors are from 5 days ago. What are the errors you're getting now.

Just a note -- the most recent errors are at the bottom of the error log.

You are right, the error is a bit different now:

2017-11-27 13:34:10,925: Error running WSGI application
2017-11-27 13:34:10,930: ModuleNotFoundError: No module named 'app'
2017-11-27 13:34:10,930:   File "/var/www/hexi_pythonanywhere_com_wsgi.py", line 16, in <module>
2017-11-27 13:34:10,930:     from app import app as application
2017-11-27 13:34:10,930: ***************************************************
2017-11-27 13:34:10,931: If you're seeing an import error and don't know why,
2017-11-27 13:34:10,931: we have a dedicated help page to help you debug: 
2017-11-27 13:34:10,931: https://help.pythonanywhere.com/pages/DebuggingImportError/
2017-11-27 13:34:10,931: ***************************************************
2017-11-27 13:34:59,391: Error running WSGI application
2017-11-27 13:34:59,391: ModuleNotFoundError: No module named 'app'
2017-11-27 13:34:59,392:   File "/var/www/hexi_pythonanywhere_com_wsgi.py", line 16, in <module>
2017-11-27 13:34:59,392:     from app import app as application
2017-11-27 13:34:59,392: ***************************************************
2017-11-27 13:34:59,392: If you're seeing an import error and don't know why,
2017-11-27 13:34:59,392: we have a dedicated help page to help you debug: 
2017-11-27 13:34:59,392: https://help.pythonanywhere.com/pages/DebuggingImportError/
2017-11-27 13:34:59,392: ***************************************************
2017-11-27 13:35:00,317: Error running WSGI application
2017-11-27 13:35:00,317: ModuleNotFoundError: No module named 'app'
2017-11-27 13:35:00,317:   File "/var/www/hexi_pythonanywhere_com_wsgi.py", line 16, in <module>
2017-11-27 13:35:00,317:     from app import app as application
2017-11-27 13:35:00,318: ***************************************************
2017-11-27 13:35:00,318: If you're seeing an import error and don't know why,
2017-11-27 13:35:00,318: we have a dedicated help page to help you debug: 
2017-11-27 13:35:00,318: https://help.pythonanywhere.com/pages/DebuggingImportError/
2017-11-27 13:35:00,318: ***************************************************

Have you tried going through the debugging hints and tips on the page mentioned in that error message?