我有一个自定义的 matplotlib 样式文件,名为“mystyle.mplstyle”。
在同一个文件夹中,我有 test.py ,其中包含以下代码:
import matplotlib.pyplot as plt
plt.style.use('mystyle.mplstyle')
该 test.py 文件运行良好。
但是如果在同一文件夹中的第二个 test2.py 文件中,我运行以下代码:
import test
它将生成以下错误消息:
回溯(最近一次调用最后一次):
文件“C:/Users/.../test2.py”,第 1 行,在
中 导入测试
文件“C:\Users... est.py”,第 3 行,在
中 plt.style.use('mystyle.mplstyle')
文件“C:\ProgramData\Anaconda3 nvs...\lib\site-packages\matplotlib\styl