Arrow: ImportError: No module named functools_lru_cache

Created on 28 Apr 2018  路  3Comments  路  Source: arrow-py/arrow

I'm getting the following exception when using arrow on Python 2.7.
Not sure if it's related to #497

Traceback (most recent call last):
  File "40-upload_to_strava.py", line 14, in <module>
    from stravalib import Client
  File "/home/matheus/.local/lib/python2.7/site-packages/stravalib/__init__.py", line 1, in <module>
    from stravalib.client import Client
  File "/home/matheus/.local/lib/python2.7/site-packages/stravalib/client.py", line 14, in <module>
    import arrow
  File "/home/matheus/.local/lib/python2.7/site-packages/arrow/__init__.py", line 3, in <module>
    from .arrow import Arrow
  File "/home/matheus/.local/lib/python2.7/site-packages/arrow/arrow.py", line 19, in <module>
    from arrow import util, locales, parser, formatter
  File "/home/matheus/.local/lib/python2.7/site-packages/arrow/parser.py", line 12, in <module>
    from backports.functools_lru_cache import lru_cache  # pragma: no cover
ImportError: No module named functools_lru_cache
$ python --version 
Python 2.7.14
$ pip show arrow
Name: arrow
Version: 0.12.1
$ pip show backports.functools_lru_cache
Name: backports.functools-lru-cache
Version: 1.5
$ pip --version
pip 9.0.3
duplicate

Most helpful comment

I stumbled upon this problem on a raspberry-pi+kodi setup.
pip install was giving me problems. (I might have messed up because of python 2.7 and python 3 pip install attempts)

Finally, this option worked correctly:
apt-get install python-backports.functools-lru-cache
(Adding it in case anybody benefits from this comment.)

All 3 comments

Probably a duplicate of #495

I stumbled upon this problem on a raspberry-pi+kodi setup.
pip install was giving me problems. (I might have messed up because of python 2.7 and python 3 pip install attempts)

Finally, this option worked correctly:
apt-get install python-backports.functools-lru-cache
(Adding it in case anybody benefits from this comment.)

Thanks for sharing @anishsane. This is an elusive issue that we are not able to nail down. We talked with the creator of the lru cache backport (who also happens to also be a maintainer of setuptools) and he was unable to figure out the fundamental problem as well. Glad you found a workaround!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adam-rudd-myob picture adam-rudd-myob  路  6Comments

pganssle picture pganssle  路  5Comments

systemcatch picture systemcatch  路  5Comments

bollwyvl picture bollwyvl  路  6Comments

Kirkman picture Kirkman  路  5Comments