Fehler laufende Matplotlib in einem kompilierten Python -Programm: DLL -Last beim Importieren _path fehlgeschlagenPython

Python-Programme
Guest
 Fehler laufende Matplotlib in einem kompilierten Python -Programm: DLL -Last beim Importieren _path fehlgeschlagen

Post by Guest »

Ich habe ein Programm, in dem ein Teil davon einige Daten mit Matplotlib in ein einfaches Diagramm zeichnet. Es funktioniert gut, wenn ich es von Pycharm ausführe, aber wenn ich es mit Pyinstaller oder automatisch-py-to-exe kompiliere, das Programm aus dem EXE ausführe und versuche, das Diagramm zu erhalten, erhalte ich den Fehler:

Code: Select all

ERROR:root:
Traceback (most recent call last):
File "weeklyGiving.py", line 837, in graph_by_date
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "graphThis.py", line 28, in 
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "matplotlib\__init__.py", line 153, in 
from . import _api, _version, cbook, _docstring, rcsetup
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "matplotlib\rcsetup.py", line 27, in 
from matplotlib.colors import Colormap, is_color_like
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "matplotlib\colors.py", line 56, in 
from matplotlib import _api, _cm, cbook, scale
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "matplotlib\scale.py", line 22, in 
from matplotlib.ticker import (
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "matplotlib\ticker.py", line 138, in 
from matplotlib import transforms as mtransforms
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "matplotlib\transforms.py", line 49, in 
from matplotlib._path import (
ImportError: DLL load failed while importing _path: The specified module could not be found.
Durch verschiedene Beiträge durch die Auseinandersetzung mit verschiedenen Dingen, wie z. ). Die msvcp140.dll- und vcruntime140.dll -Dateien, die ich verstehe, die Matplotlib benötigt. Beide sind in meinem Ordner \ windows \ system32 vorhanden. meine ide, aber nicht nach dem zusammengestellten zu exe. Irgendwelche Gedanken?

Code: Select all

import matplotlib.pyplot as plot

class LineGraph:
def __init__(self, pairs=[['2023-01-01', 352.76], ['2023-01-15', 725.48]]):
self.x = []
self.y = []
for item in pairs:
self.x.append(item[0])
self.y.append(item[1])

def graph_values_by_date_line(self):
plot.rc('xtick', labelsize=8)
plot.rc('ytick', labelsize=8)

fig, ax = plot.subplots()
ax.plot(self.x, self.y, linewidth=1.0, marker='o', markersize=2)
ax.legend()

plot.xticks(rotation=90)

figManager = plot.get_current_fig_manager()
figManager.window.showMaximized()
plot.show()
< /code>
Und mein neuester Befehl zum Kompilieren durch PyInstaller ist: < /p>
pyinstaller --noconfirm --clean --collect-all matplotlib -i "../resources/icon.ico" --add-data "../resources;resources/" --add-data "../reportlab;reportlab/" --add-data "../gsdll64.dll;gsdll64.dll" --add-data "../gsdll64.lib;gsdll64.lib" --add-data "../gsprint.exe;gsprint.exe" --add-data "../gswin64.exe;gswin64.exe" --add-data "../gswin64c.exe;gswin64c.exe" --distpath "./output" ../WeeklyGiving.py

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post