ImportError: No module named django_filters

后端 未结 5 1929
长情又很酷
长情又很酷 2020-12-16 09:34

I am using Django 1.7.1 and I pip installed django-filters to my virtual env at /.virtualenvs/auction2/lib/python2.7/site-packages$

It said it was insta

5条回答
  •  我在风中等你
    2020-12-16 10:08

    My pip version was old, really old. 1.5.6 When I installed my virtual environment it just worked, so I didn't question. Lesson learned! Here is what I did in case it helps someone else...

    In the virtual environment, I installed pip as described in the docs: https://pip.pypa.io/en/stable/installing.html python get-pip.py This upgraded me to pip 6.1.1

    pip install django-filter
    pip freeze > requirements.txt
    

    Reading requirements.txt showed I had

    django-filter==0.9.2
    django-filters==0.1.0
    

    So I uninstalled the older version with pip uninstall django-filters

    notice the s on the older version but not on the new one

    Really basic stuff but it really tripped me up. Thanks to anyone who took time to look into this!

提交回复
热议问题