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!

pls i am having issues with my webapp, it's showing me error ModuleNotFoundError: No module named 'Mywebaapp.urls', i have tried so many things but is still not working, pls i need help.

Here's out guide to debugging import errors: http://help.pythonanywhere.com/pages/DebuggingImportError/

from other_files3.FetchKiteData import FetchKiteData 2020-05-30 15:18:34 ImportError

2020-05-30 15:18:34 No module named other_files3.FetchKiteData showing this error no module named please help me

2020-05-30 16:11:36 File "Main.py", line 5, in <module> 2020-05-30 16:11:36
2020-05-30 16:11:36 from other_files.FetchKiteData import FetchKiteData 2020-05-30 16:11:36 File "/home/rajakishore/TradingGoAlgo/other_files/FetchKiteData.py", line 1, in <module> 2020-05-30 16:11:36
2020-05-30 16:11:36 from kiteconnect import KiteConnect 2020-05-30 16:11:36 ImportError 2020-05-30 16:11:36 : 2020-05-30 16:11:36 No module named kiteconnect 2020-05-30 16:11:36 2020-05-30 16:11:36 rani 2020-05-30 16:11:41 /home/rajakishore/TradingGoAlgo why this error is showing

That looks like you have not installed the kiteconnect package into the version of Python/virtualenv that you're using for your web app.

enter image description here I have encouter an import error as below: why and how to fix it?

@Kelvinloh76 -- we have a help page on that.