Forums

ImportError: No module named crispy_forms

[edited by admin: formatting]

Traceback (most recent call last):

  File "./manage.py", line 10, in <module>execute_from_command_line(sys.argv)

  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()

  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 338, in execute
    django.setup()

  File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)

  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)

  File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 94, in create
    module = import_module(entry)

  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)

ImportError: No module named crispy_forms

I have tried everything to get this to work. I have reloaded the web app.

I have also tried installing both inside and outside the virtual environment using the easy install and the pip install and the pip3 install.

Don't really know what to do next. Your help is appreciated.

So judging from the traceback, you would need to "pip2.7 install --user". What happens when you do that install?

Hi i don't know why the traceback is saying that the python version is 2.7.

I ran this....

$ mkvirtualenv --python=/usr/bin/python3.7 mysite-virtualenv

and it said something about depreciated f(l)avor.

However when I checked the interpreter it said the version was 3.7.

Why does it say python 2.7 and how do i fix that?

seems like after you fixed the python version and set up your webapp to use your virtualenv correctly (from the webapp tabs settings), and reloaded your webapp, your website is now working?

Yes but I still cant use manage.py migrate it still comes out with a ImportError: No module named crispy_forms

does this have something to do with the python 2.7?

Hi when trying to create the 3.7 environment this is whats happening


CRHerna@glenn-liveconsole7:~$ mkvirtualenv --python=/usr/bin/python3.7 mysite-virtualenv

Running virtualenv with interpreter /usr/bin/python3.7

Using base prefix '/usr'

/usr/local/lib/python2.7/dist-packages/virtualenv.py:1041: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses

import imp

New python executable in /home/CRHerna/.virtualenvs/mysite-virtualenv/bin/python3.7

Also creating executable in /home/CRHerna/.virtualenvs/mysite-virtualenv/bin/python

Installing setuptools, pip, wheel...


Why is it looking in python2.7?

can you give the exact commands from when you made the virtualenv to when you ran the code? Where is this error traceback that you are seeing? Is it from the webapp error logs? Or from the console? Or from running code from the file editor?

hey did anyone ever find the answer to his problem? i am facing the same issue

did you follow the solutions suggested?