![Python matplotlib - ImportError: functools_lru_cache라는 모듈이 없습니다.](https://rvso.com/image/1157684/Python%20matplotlib%20-%20ImportError%3A%20functools_lru_cache%EB%9D%BC%EB%8A%94%20%EB%AA%A8%EB%93%88%EC%9D%B4%20%EC%97%86%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
오류 없이 완료된 matplotlib
Python을 사용하여 설치했습니다 . pip
하지만 가져오려고 하면 다음 오류가 발생합니다.
import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/rishabh/.local/lib/python2.7/site-packages/matplotlib/__init__.py", line 131, in <module>
from matplotlib.rcsetup import defaultParams, validate_backend, cycler
File "/home/rishabh/.local/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 29, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "/home/rishabh/.local/lib/python2.7/site-packages/matplotlib/fontconfig_pattern.py", line 28, in <module>
from backports.functools_lru_cache import lru_cache
ImportError: No module named functools_lru_cache
답변1
이것을 시도해 보세요. 오늘 아침에도 같은 문제가 발생했습니다.
sudo apt-get install python-matplotlib
또한 몇 가지 모듈을 설치한 후 조금 후에 python3.7을 사용하고 있습니다. 나는 달렸다.
pip3 install matplotlib
이제 matplotlib을 가져올 수 있습니다.
답변2
먼저 제거
pip uninstall backports.functools_lru_cache
그런 다음 다시 설치하세요.
pip install backports.functools_lru_cache
설명한 것처럼이 답변에서.