0

System info: 64-bit OS-X, Python 3.7

I am converting a Django website from Python 2 to Python 3. To do this, I ran 2to3 on the whole project. I then installed all of the required modules in INSTALL_APPS in settings.py - except one: django_comments.

(env) user:languages user$ pip3 install django_comments
Collecting django_comments
  Using cached https://files.pythonhosted.org/packages/c7/df/3a752f3e393b470087304dd47be6a4bad9867e7ec33963ff022d32143700/django-comments-1.0.0.b.tar.bz2
    ERROR: Command errored out with exit status 1:
     command: /Users/user/.../env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tb/vbtzyvv92hz6262qv7x8r8jh0000gn/T/pip-install-xjv_0ird/django-comments/setup.py'"'"'; __file__='"'"'/private/var/folders/tb/vbtzyvv92hz6262qv7x8r8jh0000gn/T/pip-install-xjv_0ird/django-comments/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: /private/var/folders/tb/vbtzyvv92hz6262qv7x8r8jh0000gn/T/pip-install-xjv_0ird/django-comments/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/tb/vbtzyvv92hz6262qv7x8r8jh0000gn/T/pip-install-xjv_0ird/django-comments/setup.py", line 12, in <module>
        version = get_version(),
      File "/private/var/folders/tb/vbtzyvv92hz6262qv7x8r8jh0000gn/T/pip-install-xjv_0ird/django-comments/django_comments/__init__.py", line 4, in get_version
        return u'.'.join(map(unicode, VERSION))
    NameError: name 'unicode' is not defined
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I have found that this may be related to compatibility with Python 3 and that one potential fix is to replace unicode with str. However, this is a module that I would like to work in Python 3 since the Django project relies on this for comments currently. Is it deprecated essentially with no way to work outside of retooling it myself? Thank you.

woefipuasd
  • 23
  • 4
  • I believe it is still being maintained. What happens when you update it to the latest version using `pip`? https://django-contrib-comments.readthedocs.io/en/latest/ – Selcuk Sep 25 '19 at 06:01
  • django-comments appears to be a library that was uploaded 8 years ago and never modified since. There is no chance it will work with recent versions of Python or Django. However there are many many comment libraries that *are* maintained, you should use one of them: see [this grid](https://djangopackages.org/grids/g/commenting/). – Daniel Roseman Sep 25 '19 at 07:32

1 Answers1

1

I know this is a little late but I believe the django_comments was moved to django-contrib-comments. Here should be the latest documentation.

nuttalld
  • 11
  • 1