youknowone / ring

Python cache interface with clean API and built-in memcache & redis + asyncio support.
http://ring-cache.readthedocs.io/en/latest/
Other
478 stars 37 forks source link

ring 0.8.0 + python 2.7.13 = AttributeError: 'module' object has no attribute 's' #166

Closed yodog closed 3 years ago

yodog commented 3 years ago
:~# python -V

Python 2.7.13
:~# cat /usr/local/lib/python2.7/dist-packages/ring/__version__.py

__version__ = '0.8.0'
:~# /opt/scripts/rag/drive/v2.py -h

Traceback (most recent call last):
  File "/opt/scripts/rag/drive/v2.py", line 17, in <module>
    import ring
  File "/usr/local/lib/python2.7/dist-packages/ring/__init__.py", line 8, in <module>
    from ring.func import (
  File "/usr/local/lib/python2.7/dist-packages/ring/func/__init__.py", line 7, in <module>
    from ring.func import sync
  File "/usr/local/lib/python2.7/dist-packages/ring/func/sync.py", line 12, in <module>
    from . import base as fbase, lru_cache as lru_mod
  File "/usr/local/lib/python2.7/dist-packages/ring/func/base.py", line 605, in <module>
    @attr.s
AttributeError: 'module' object has no attribute 's'
youknowone commented 3 years ago

ring 0.8.0 requires attrs dependency, but it was missing it in setup.py. I will update it. But the error looks weird. The error must be ImportError because attrs is not installed, but your log looks like you have another module named attr. If you have another module names attr, it will not work even after update. You still need to check the name-collision raised module.

yodog commented 3 years ago

i will check again after your update

youknowone commented 3 years ago

please try https://pypi.org/project/ring/0.8.1/ and check if you have attr.py in your project.

yodog commented 3 years ago
Installing collected packages: attrs, ring
  Attempting uninstall: ring
    Found existing installation: ring 0.7.3
    Uninstalling ring-0.7.3:
      Successfully uninstalled ring-0.7.3
Successfully installed attrs-21.2.0 ring-0.8.1

working perfectly. thanks.