我遇到了这个问题
Traceback (most recent call last):
File "Path.py", line 4, in <module>
import matplotlib.pyplot as plt
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 131, in <module>
from matplotlib.rcsetup import defaultParams, validate_backend, cycler
File "C:\Python27\lib\site-packages\matplotlib\rcsetup.py", line 29, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "C:\Python27\lib\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
到目前为止我已尝试过: -
我已经为VS Code安装了 Python和Pylint 。它不仅与VS Code有关,我也无法直接从CMD运行代码。
答案 0 :(得分:0)
考虑使用此技术导入'lru_cache'函数:
try:
from functools import lru_cache
except ImportError:
from backports.functools_lru_cache import lru_cache
无论如何,这是网站: https://pypi.python.org/pypi/backports.functools_lru_cache
你也可以在行命令
中这样做pip install backports.functools_lru_cache