问题
import matplotlib.pyplot as plt
#运行后报错
ImportError: DLL load failed while importing _imaging: 找不到指定的模块。
但在VisualStudioCode中选择base内核后又可以正常运行。
解决:
1、python 和 matplotlib 的版本不兼容:查看 base 环境和自己搭建的虚拟环境中的matplotlib的版本,两个版本不一样,改成同一个版本(检查是否可以解决);
2、matplotlib 和 pillow 版本不兼容:同样,查看 base 和 自己搭建的虚拟环境中的pillow版本,改成一样的版本 。
## 查看指定环境下库版本的方法:
pip show matplotlib
pip show pillow