monim67 / django-flatpickr

Flatpicker based DatePickerInput, TimePickerInput and DateTimePickerInput with date-range-picker functionality for django >= 2.0
https://pypi.org/project/django-flatpickr/
MIT License
63 stars 11 forks source link

ModuleNotFoundError: No module named 'flatpickr' #6

Closed brylie closed 1 year ago

brylie commented 4 years ago

Describe the problem I have installed django-flatpickr as described in the installation instructions, and it works correctly in my Wagtail CMS project. When I use flatpickr in a model file, I use the documented import syntax:

from flatpickr import DatePickerInput

However, my IDE (VS Code) keeps complaining:

Unable to import 'django_flatpickr'pylint(import-error)

Likewise, when trying to run the Django shell, I get the following error:

$ python manage.py shell
...
ModuleNotFoundError: No module named 'flatpickr'

Expected behavior I would hope that the IDE would be able to find the flatpickr import and that I would be able to run a Django shell.

MarwinFrancis commented 2 years ago

Is 'flatpickr' added to INSTALLED_APPS in settings.py ?

brylie commented 2 years ago

Yes. Although this issue was opened almost two years ago :smile:

https://github.com/WesternFriend/WF-website/blob/fed01250e2f26c2f4fe569a5d907c67c39285f9f/core/settings/base.py#L102

monim67 commented 1 year ago

If anyone is facing this issue in 2022, probably you have installed/upgraded to django-flatpickr >= 2 which have some major changes.

Please see README to upgrade your codebase for django-flatpickr >= 2, otherwise install django-flatpickr < 2 to resolve the issue.