1024programmer Java django_filters import failed

django_filters import failed

Importing django_filters failed, No module named ‘django_filter’

1. Enter the virtual environment workon virtual environment name, enter pip list

(django_py3_1.11) python@ubuntu:~$ pip list
Looking at the pip installation list, there is django-filters 0.2.1, and there seems to be no problem

django_filters import failed

2. Manually enter the site-packages directory of the virtual environment:

cd ~/.virtualenvs/django_py3_1.11/lib/python3.5/site-packages/
The above ”django_py3_1.11” is my own virtual environment name, and I need to change it to my own; similarly ‘python3.5’ also needs to be modified according to your own python version.

3. Enter the ll command to view all files in the directory

…/site-packages$ ll
It was found that there is only the ”django_filters-0.2.1.dist-info” directory, and there is no ”django_filters”, and you need to find it when importing the package. django_filters”, proves that there is a problem with the package

django_filters import failed

4. I noticed that django-filter has more development, and the page has been upgraded to v2.0.0, but pip installed 0.2.1, we should only install it in another way.

After reading the README document, I found that the installation method of the new version is:

pip install django-filter # No need to use s after installing the new version

5. Uninstall the original version and use it again

pip install django-filter

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/768497

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索