Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named functools_lru_cache #229

Closed
courtyardz opened this issue Oct 25, 2018 · 9 comments
Closed

ImportError: No module named functools_lru_cache #229

courtyardz opened this issue Oct 25, 2018 · 9 comments

Comments

@courtyardz
Copy link

I am unsure if the issue is caused by my recent upgrade to Ubuntu 18.10. I have tried reinstalling td-watson and the backports.functools_lru_cache through pip. But I keep getting the following error:

Traceback (most recent call last):
  File "/usr/local/bin/watson", line 7, in <module> from watson.__main__ import cli
  File "/usr/local/lib/python2.7/dist-packages/watson/__init__.py", line 1, in <module> from .watson import __version__  # noqa
  File "/usr/local/lib/python2.7/dist-packages/watson/watson.py", line 14, in <module> import arrow
  File "/usr/local/lib/python2.7/dist-packages/arrow/__init__.py", line 3, in <module>from .arrow import Arrow
  File "/usr/local/lib/python2.7/dist-packages/arrow/arrow.py", line 19, in <module> from arrow import util, locales, parser, formatter
  File "/usr/local/lib/python2.7/dist-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

Any ideas on how to fix? As far as I can tell, backports.functools_lru_cache is installed correctly into .../python2.7/dist-packages/directory.

@MinchinWeb
Copy link
Contributor

What version of arrow is installed? Version 0.11.0 is broken, and version 0.12.0 does weird things if your system has both Python 2 and Python 3 installed. The latest version of arrow is 0.12.1.

@courtyardz
Copy link
Author

Thanks, but arrow is 0.12.1.

@plup
Copy link

plup commented Nov 10, 2018

I get the same error on first install:

$ pip install --user watson

$ watson --help
Traceback (most recent call last):
  File "/home/plup/.local/bin/watson", line 7, in <module>
    from watson.__main__ import cli
  File "/home/plup/.local/lib/python2.7/site-packages/watson/__init__.py", line 1, in <module>
    from .watson import __version__  # noqa
  File "/home/plup/.local/lib/python2.7/site-packages/watson/watson.py", line 14, in <module>
    import arrow
  File "/home/plup/.local/lib/python2.7/site-packages/arrow/__init__.py", line 3, in <module>
    from .arrow import Arrow
  File "/home/plup/.local/lib/python2.7/site-packages/arrow/arrow.py", line 19, in <module>
    from arrow import util, locales, parser, formatter
  File "/home/plup/.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

$ pip show arrow
Name: arrow
Version: 0.12.1
Summary: Better dates and times for Python
Home-page: https://github.com/crsmithdev/arrow/
Author: Chris Smith
Author-email: crsmithdev@gmail.com
License: Apache 2.0
Location: /home/plup/.local/lib/python2.7/site-packages
Requires: python-dateutil, backports.functools-lru-cache

The debian testing packaged version (1.6.0) works though

@jmaupetit
Copy link
Member

🤔 looks like we need to fix project requirements.

@tanius
Copy link

tanius commented Nov 21, 2018

Same issue here, under Ubuntu 18.04 though.

For the meantime, a workaround is installing watson 1.6.0 from the Debian Testing repo under Ubuntu:

wget http://ftp.debian.org/debian/pool/main/w/watson/watson_1.6.0-3_all.deb
wget http://ftp.debian.org/debian/pool/main/w/watson/python3-watson_1.6.0-3_all.deb
sudo apt install -y ./watson_1.6.0-3_all.deb ./python3-watson_1.6.0-3_all.deb

@jmaupetit
Copy link
Member

jmaupetit commented Nov 21, 2018

Hey @tanius 👋 Thanks for the info: I didn't know there was a Debian package for Watson 😉

@ThomasWaldmann
Copy link
Contributor

arrow-py/arrow#495

@plup
Copy link

plup commented Dec 14, 2018

Another "workaround" is to install it with python3:

$ pip3 install --user td-watson

This is good enough to me !

@davidag
Copy link
Contributor

davidag commented Sep 9, 2019

@jmaupetit As @ThomasWaldmann mentioned, this was an arrow issue. Maybe this could be closed hoping that it's definitely fixed 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants