mbi / django-simple-captcha

Django Simple Captcha is an extremely simple, yet highly customizable Django application to add captcha images to any Django form.
http://django-simple-captcha.readthedocs.io/en/latest/
MIT License
1.38k stars 320 forks source link

python 2.7 compatibility #129

Open AymRod opened 6 years ago

AymRod commented 6 years ago

With python 2.7, when installing django-simple-captcha with pip 9.0, pip downloads django 2.0 (released 2017/12/02), and executes the command python setup.py egg_info, which results in an error: AttributeError: 'module' object has no attribute 'lru_cache'. Before django 2.0 was released, it installed django 1.11, and there was no problem. django <2.0 did support python 2.7, but django >=2.0 does not, which is I think the cause of the bug. To sum up, "pip install django-simple-captcha" downloads django 2.0 which is not compatible with python 2.7.

dsc_error

mbi commented 6 years ago

Hmm yes, I see the problem, but I'm note quite sure how to express a dynamic dependency in setup.py based on whether we're installing with Py2 or Py3.

Any ideas?

EDIT: here is the answer!

prokaktus commented 6 years ago

As a workaround, you could install Django first and then install django-simple-captcha.

jannh commented 4 years ago

Well... since python2 and Django 1.11 are both EOL by now, would it make sense to drop support for python2 and require Django 2.2+ (which is the oldest version of Django currently supported)?