Forums

Module Import Error

Hi, I have a very strange problem. basically my demo site is not loading site url: http://bolt123.pythonanywhere.com/ I checked the error log, it shows following. I can import from shell like the one describe https://help.pythonanywhere.com/pages/DebuggingImportError/. Module "multiselectfield" is loading perfectly from shell. But when i run site it shows following import error. Can you help me to resolve this problem.

************* LOGS **************
2018-04-15 20:22:49,323: Error running WSGI application
2018-04-15 20:22:49,324: ImportError: No module named multiselectfield
2018-04-15 20:22:49,324:   File "/var/www/bolt123_pythonanywhere_com_wsgi.py", line 25, in <module>
2018-04-15 20:22:49,324:     application = get_wsgi_application()
2018-04-15 20:22:49,324: 
2018-04-15 20:22:49,324:   File "/usr/local/lib/python2.7/dist-packages/django/core/wsgi.py", line 13, in get_wsgi_application
2018-04-15 20:22:49,324:     django.setup(set_prefix=False)
2018-04-15 20:22:49,324: 
2018-04-15 20:22:49,324:   File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup
2018-04-15 20:22:49,324:     apps.populate(settings.INSTALLED_APPS)
2018-04-15 20:22:49,324: 
2018-04-15 20:22:49,324:   File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate
2018-04-15 20:22:49,325:     app_config = AppConfig.create(entry)
2018-04-15 20:22:49,325: 
2018-04-15 20:22:49,325:   File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 90, in create
2018-04-15 20:22:49,325:     module = import_module(entry)
2018-04-15 20:22:49,325: ***************************************************

[edited by admin: formatting]

what version of python do you expect to be running, and do you have a virtualenv setup? make sure those settings are all correct in your PythonAnywhere webapps page

python version 2.7, and yes i have setup a virtual env. It was working before i add multiselectfield, i did a test like thi https://help.pythonanywhere.com/pages/DebuggingImportError/ and the environment is working i can import multiselectfield from shell

in my localhost it will not prompt any error, and i changed my previous change set , that will also work on server

If you've created a virtualenv, your website currently isn't using it -- you need to specify the env on the "Web" page.

Yes, now its works. Thankyou. Then how it works earlier. I was created environment at the beginning itself and the program works till now. I think django is installed globally, and my new package is in environment.

thank you its working now

Excellent, glad you got it working!