找不到 matplotlib 数据文件 [英] Could not find the matplotlib data files

查看:60
本文介绍了找不到 matplotlib 数据文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 python 新手,我正在尝试使用 pyinstaller 从 py 脚本创建一个 .exe,但在尝试运行 .exe 时出现此错误:找不到 matplotlib 数据文件.当我在 python idle 中运行脚本时,我没有收到此错误.

I am new to python and I am trying to create an .exe from py script with pyinstaller but I get this error when trying to run the .exe: Could not find the matplotlib data files. When i run the script in python idle i dont get this error.

我试过了:

 import matplotlib
   setup(
        data_files=matplotlib.get_py2exe_datafiles(),
   )

但我收到一条错误消息,提示未定义设置.

But i get an error saying that setup is not defined.

推荐答案

我已经通过将 matplotlib 降级到 3.0.3 版解决了这个问题使用这个命令:python -m pip install matplotlib==3.0.3

I've fixed the problem by downgrading matplotlib to version 3.0.3 Using this command: python -m pip install matplotlib==3.0.3

这篇关于找不到 matplotlib 数据文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆