简体   繁体   English

ModuleNotFoundError:从 pyinstaller 运行 exe 时没有名为“matplotlib.backends.backend_svg”的模块

[英]ModuleNotFoundError: No module named 'matplotlib.backends.backend_svg' when running exe from pyinstaller

I want to compile a python file to a standalone.exe programm using pyinstaller onefile.我想使用 pyinstaller onefile 将 python 文件编译为standalone.exe 程序。 Running the python file, everything works fine, but running the.exe file, it throws the exception运行 python 文件,一切正常,但运行 .exe 文件,它抛出异常

ModuleNotFoundError: No module named 'matplotlib.backends.backend_svg' ModuleNotFoundError:没有名为“matplotlib.backends.backend_svg”的模块

I am using schemdraw , and schemdraw uses matplotlib.我正在使用schemdraw ,而 schemdraw 使用 matplotlib。

Because I dont want matplotlib to open a window everytime I export an svg I use the backend "Agg" with matplotlib.因为我不希望 matplotlib 每次导出 svg 时都打开 window 我使用带有 ZF020313239EEEB5A654 的后端“Agg”

import matplotlib.backends.backend_tkagg
import matplotlib
matplotlib.use('Agg')

  • I of course have tried reinstalling matplotlib我当然尝试过重新安装 matplotlib
  • Using instead of pyinstaller --onefile <file> pyinstaller <file>使用而不是 pyinstaller --onefile <file> pyinstaller <file>
  • I tried putting import matplotlib.backends.backend_tkagg over import matplotlip我尝试将import matplotlib.backends.backend_tkagg放在import matplotlip
  • upgrading matplotlib pip install matplotlib --upgrade --user basicly this post .升级 matplotlib pip install matplotlib --upgrade --user基本上这个帖子 But since this isn't exactly my problem and none of it worked I am asking here但由于这不完全是我的问题,而且都没有奏效,我在这里问

Thanks in advance提前致谢

Do you need to use Matplotlib for anything other than schemdraw?您是否需要将 Matplotlib 用于除 schemdraw 之外的任何内容? If not, you can set schemdraw to draw straight to SVG:如果没有,您可以设置 schemdraw 直接绘制到 SVG:

schemdraw.use('svg')

then it won't even go through Matplotlib.那么它甚至不会从 go 到 Matplotlib。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 导入 matplotlib.backends.backend_tkagg - ModuleNotFoundError:没有名为“PIL”的模块 - import matplotlib.backends.backend_tkagg - ModuleNotFoundError: No module named 'PIL' 'ModuleNotFoundError:运行 PyInstaller.exe 文件时没有名为 'keras.engine.base_layer_v1' 的模块 - 'ModuleNotFoundError: No module named 'keras.engine.base_layer_v1'' when running PyInstaller .exe file “moduleNotFoundError:没有名为'pyautogui'的模块”仅在pyinstaller exe中 - "moduleNotFoundError: No module named 'pyautogui'" only in pyinstaller exe pyinstaller exe 未运行 - 没有名为 Pyside 的模块 - pyinstaller exe not running - No module named Pyside exe 构建后的 Pyinstaller 错误:ModuleNotFoundError: No module named 'cmath' - Pyinstaller Error after exe built: ModuleNotFoundError: No module named 'cmath' ModuleNotFoundError:没有名为“joblib._parallel_backends”的模块 - ModuleNotFoundError: No module named 'joblib._parallel_backends' Pyinstaller - ModuleNotFoundError:没有名为“cpuinfo”的模块 - Pyinstaller - ModuleNotFoundError: No module named 'cpuinfo' PyInstaller:ModuleNotFoundError:没有名为“编码”的模块 - PyInstaller: ModuleNotFoundError: No module named 'encodings' pyinstaller ModuleNotFoundError:没有名为“桨”的模块 - pyinstaller ModuleNotFoundError: No module named 'paddle' 我试图通过pyinstaller制作.exe文件时遇到此错误-“ ModuleNotFoundError:没有名为&#39;acrcloud_extr_tool&#39;的模块” - I'm getting this error when I'm trying to make an .exe file through pyinstaller - “ModuleNotFoundError: No module named 'acrcloud_extr_tool'”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM