pyinstaller 打包之后Could not find the matplotlib data files

目录

pyinstaller 打包之后Could not find the matplotlib data files

问题

常见解决方案

其他解决方案


笔者使用的python版本为3.8.5

pyinstaller版本为4.3

matplotlib版本为4.3

问题

Runtime Error Could not find the matplotlib data files

常见解决方案

许多网络上的解决方案如下: 就是降低matplotblib的版本,笔者原本matplotlib的版本为4.3

pip install matplotlib==3.0.3

pip install matplotlib==3.1.3

笔者同事降低为3.0.3错误依旧;

降低为3.1.3成功

其他解决方案

找到你的python安装的pyinstaller的hooks文件夹中的hook-matplotlib.py文件:

修改文件中文本旧有内容:

datas = [ (mpl_data_dir, "mpl-data"), ]

改为:

datas = [ (mpl_data_dir, "matplotlib/mpl-data"), ]

# 使用UE或者文本编辑器打开hook-matplotlib.py文件

# 内容如下,修改之后保存即可;

#-----------------------------------------------------------------------------
# Copyright (c) 2013-2019, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------from PyInstaller.utils.hooks import exec_statementmpl_data_dir = exec_statement("import matplotlib; print(matplotlib._get_data_path())")datas = [(mpl_data_dir, "mpl-data"),
]

Find and edit the hook-matplotlib.py inside of lib/site-packages/pyinstaller/hooks

edit the data section from: datas = [ (mpl_data_dir, "mpl-data"), ]

to

datas = [ (mpl_data_dir, "matplotlib/mpl-data"), ]

参考:Could not find the matplotlib data files

参考:matplotlib: RuntimeError: Could not find the matplotlib data files #393

pyinstaller打包之后运行出现:Could not find the matplotlib data files相关推荐

  1. python 打包exe出现RuntimeError: Could not find the matplotlib data files 的解决方法

    在打包包含matplotlib库时出现RuntimeError: Could not find the matplotlib data files的解决方法. 错误提示里面的介绍: Matplotli ...

  2. pyinstaller打包torch运行后报错

    pyinstaller打包torch运行后报错 这个实际上网上很多类似的,但不太相同,得观察报错信息是否一致.如果报错的最后面有torchvision,则应该是版本问题,进行版本修改估计就ok了,但如 ...

  3. python-barcode 使用pyinstaller打包后运行报错cannot open resource

    python-barcode 使用pyinstaller打包后运行报错cannot open resource 问题描述: 使用pycharm可以正常生成条码,但是使用pyinstaller打包后,提 ...

  4. macOS pyinstaller 打包之后运行报 Error loading Python lib

    背景 在macOS 上,用pyinstaller打包app,pyinstaller==5.1, python3.8, 因为代码都是在pycharm上,安装了虚拟环境,运行的. 问题1: 打包的时候直接 ...

  5. python使用pyinstaller打包后运行报错排查思路

    程序使用win10 ,python39 编写 使用pyinstaller打包成exe 在本机运行正常在其他win7电脑运行报错 报错原因: python3.9 不支持win7系统 解决方案:使用pyt ...

  6. python / 解决 pyinstaller 打包后运行时提示找不到模块的问题

    在打包时候,并没有提示错误,可以顺利打包成 exe 文件.但是在运行打包好的软件时,会提示找不到模块,本人遇到的是找不到第三方模块,例如 requests .这时候需要在打包时指定 -p 参数,后面跟 ...

  7. Python笔记-解决pyinstaller打包后运行时动态加载模块报错(No module named)

    出现的问题就是:No module named 原因是我代码里面使用了这个 importlib.import_module pyinstaller没有检测到. 百度上没有找到解决办法,在外wang找到 ...

  8. 如果你也被pyinstaller折磨,建议阅读,pyinstaller打包教程。

    最近打算把自己写的程序用pyinstaller做一个打包,以便在其他电脑上使用,本来以为挺简单的事情,没想到搞了两天时间才搞定,期间遇到诸多坑,忍不住要骂娘了. 平心而论,搞不定只能是自己学艺不精,所 ...

  9. pyinstaller打包生成的exe文件(并设置运行时静默)

    pyinstaller打包生成的exe文件(并设置运行时静默) 目录 pyinstaller打包生成的exe文件(并设置运行时静默)

最新文章

  1. 为衣服添加NFC功能:挥下袖子就能安全支付,打开车门坐进去就能启动汽车|Nature子刊...
  2. linux日志分析与痕迹清理
  3. 这些数学趣图,数学老师看了后会怎么想?
  4. java自动推送百度收录_站点添加百度自动推送和360自动推送代码,让收录更快!...
  5. python物理建模初学者指南 pdf 脚本之家_Blender权威指南 罗聪翼 著 中文 PDF 清晰扫描版 [114M]...
  6. Multisim软件实验
  7. 永磁同步电机矢量控制(四)——simulink仿真搭建
  8. 微信小程序 — 公立医院申请
  9. 机器是如何学习的?(监督式学习)
  10. 解决Could not get a resource from the pool 异常问题
  11. 独家揭秘!2.5亿用户的美团智能推荐平台是如何构建的?
  12. 北京国家会计学院聂兴凯:用友BIP事项会计助力企业迈入智能会计时代
  13. win10系统c盘C:Users后面的用户名怎么更改
  14. 【linux命令】df和du的区别、文件系统
  15. docker安装和启动
  16. Tornado.Cash终于,终于发币了!TORN治理机制都在这里
  17. 【读点论文】PP-ShiTu: A Practical Lightweight Image Recognition System,百度推出的强大人工智能产品
  18. java里面xml sql写法
  19. php接入七牛云api
  20. Datalogic得利捷将亮相2023广州国际工业自动化技术及装备展览会

热门文章

  1. 嵌入式系统笔记之自动登录
  2. java中是否支持多重继承_java支持多重继承吗 JAVA特性面试题:
  3. qq无限时间撤回消息bug_手机QQ新功能汇总,比微信有意思多了
  4. Random在for以及foreach循环中产生相同随机数问题
  5. C/C++如何检查系统内存泄露与使用情况?
  6. Udev串口通讯,对于多个ttyUSB,如何自动识别?
  7. ECCV2020 | 北京大学提出RGB-D语义分割新网络,多模态信息融合
  8. OpenCV中initUndistortRectifyMap函数存在bug原因探究
  9. vue 绑定事件,获取元素对象
  10. 如何根据点云计算对应物体的长宽