标签 debian 下的文章

debian安装ipython后报ImportError: No module named functools_lru_cache异常

在debian安装ipython

# 安装ipython
pip install ipython
# 验证是否安装成功
ipython

报如下异常:

Traceback (most recent call last):
...
  File "/usr/local/lib/python2.7/dist-packages/wcwidth/wcwidth.py", line 79, in <module>
    from backports.functools_lru_cache import lru_cache
ImportError: No module named functools_lru_cache

因为通过pip安装的backports.functools_lru_cache有问题,着手解决:

# 从pip卸载
pip uninstall backports.functools_lru_cache
# 通过apt安装
apt install python-backports.functools-lru-cache

搞定!