ImportError: No module named crispy-forms

最后都变了- 提交于 2019-12-03 12:06:26

I solve this problem right now, I realize that the crispy-form installed version was the python 2.7 version, but I'm using Django-1.10 with python 3.5, and I think this is your problem too.

Try: pip3 install --user django-crispy-forms

kristian

You have to make sure that you install crispy-forms into the virtualenv.

  1. Activate VirtualEnv (where env is the directory/name of your virtual environment):

    source env/bin/activate

  2. Install crispy-forms

    pip install django-crispy-forms

As per the documentation : http://django-crispy-forms.readthedocs.org/en/latest/install.html#installing-django-crispy-forms, you have to add 'crispy_forms' not 'crispy-forms' to your Installed Apps list.

beowwwulf

Ok, so I found by chance(almost) another post, this one: Getting stuck at Django error: No module named registration

and thought it might have something to do with pythonpath.

so then I tried easy_install, like suggested:

 $ easy_install -Z django-crispy-forms
    Searching for django-crispy-forms
    Best match: django-crispy-forms 1.4.0
    Adding django-crispy-forms 1.4.0 to easy-install.pth file

    Using /home/nr1/Envs/abc/lib/python2.7/site-packages
    Processing dependencies for django-crispy-forms
    Finished processing dependencies for django-crispy-forms

Now it works! I still think there might be something missing with the pythonpath, because I keep getting this in eclipse:

SignUpView Found at: __module_not_in_the_pythonpath__

, and I would like someone to clarify it, so feel free to contribute here...

but django and crispy_forms now works together. YippikayeyMF!!

I use PyCharm for my Django projects. I get exactly the same error as you but in PyCharm until I change the Python interpreter used by PyCharm for the project. I have to, for each project, select the Python interpreter that resides in the relevant virtalenv folder to get the IDE (PyCharm) to recognize the installed modules. I suspect that the Pythonpath lurks somewhere in the background...

Doesn't Eclipse allow you to select the interpreter to use for a project? That's where I'd start looking.

Good luck!

Chiradip

I came across the same problem and figured out an alternate way around.

  1. Exit Virtualenv.
  2. Do a fresh pip install of crispy form at the root directory.
  3. Go back to Virtualenv and make migrations followed by migrate.

I think the django installation needs that all third party app be installed inside and as well outside the virtual env.
I would really appreciate if someone could help me with inside details behind the reason.

All the above answers are missing one thing. Please cross check the location of your 'External Libraries' on the drive first before you do any of the above advises. Reason: - You be using an IDE that points to a different python directory, that is for guys who have install python more than once.

  • don't think your 'virtualenv' is pointing to the right directory were your 'External Libraries' are stored. So if you go ahead and install in a wrong directory then such error will ok
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!