Forums

ImportError: No module named 'widget_tweaks'

I installed django-widget-tweaks for rendering forms but when I am trying to configure the application from GitHub (using pa_auto_configure....) it throws an ImportError saying it does not have any module named widget_tweaks. I have installed django-widget-tweaks using pip, pip3.6, and pip3.

Are you using Python 3.6 for your web app? If you're using a different version of Python, then you should install it for the version you're using. Unless you're using a virtualenv, then you need to install it into the virtualenv.

@glenn exactly I had the same problem: This is how I solved it: There is a virtualenv that is created by default and you need to activate it and install django-widget-tweaks inside it. First cd into the home directory in the bash shell: cd ~ then cd .virtualenvs/ (remember to add the ".") then cd into the virtualenv your web application is using... it's usually the same name as the website name then cd bin/ then type 'source activate' to activate the virtualenv If you are using python3 for your web app, then install django-widget-tweaks with pip3 --> pip3 install django-widget-tweaks if you are using python2 then --> pip install django-widget-tweaks

When you are done, go to the 'Web' section and reload your web app. It should run fine Hope this helps