python 2.7 functools_lru_cache does not import although installed

前端 未结 14 1713
星月不相逢
星月不相逢 2020-12-05 17:21

When I try to import matplotlib I get an error

Traceback (most recent call last):
  File \"\", line 1, in 
  File \"/usr/local/lib         


        
相关标签:
14条回答
  • 2020-12-05 18:20

    Install arrow using:

    pip install arrow==0.12.0 
    

    fixed this issue for me

    0 讨论(0)
  • 2020-12-05 18:20

    If you're experiencing this issue on Ubuntu 18.x (and maybe other versions): it is caused by this Ubuntu bug. The problem is in the Ubuntu package python-configparser which is installed as a dependence of python-pip. It contains empty __init__ file

    /usr/lib/python2.7/dist-packages/backports/__init__.py

    Hence, pip modules installed to /usr/local/lib/python2.7/dist-packages/backports are simply ignored. As soon as this bug is not fixed yet, the easiest way to fix this is to remove this package:

    sudo apt remove python-configparser
    

    It does not any harm to any of your backports modules installed by pip (since they are in another folder), and this is much safer than version downgrade.

    See also this pip issue with similar problem around backports module.

    0 讨论(0)
提交回复
热议问题