Pyinstaller enthält nicht Numpy für Plotly ExpressPython

Python-Programme
Anonymous
 Pyinstaller enthält nicht Numpy für Plotly Express

Post by Anonymous »

Ich habe ein Programm, das mit Pandas, Plotly und Tkinter arbeitet. Es läuft wie erwartet in Pycharm. Zu Ihrer Information, hier sind die Importe: < /p>

Code: Select all

import tkinter as tk
import tkinter.filedialog as fd
import plotly.express as px
import pandas
< /code>
Ich versuche jetzt, dieses Programm mit PyInstaller für Windows zu bündeln. Das Generieren der Exe funktioniert, aber ich erhalte den folgenden Fehler beim Ausführen des Programms: < /p>
Traceback (most recent call last):
File "[PATH]\main.py", line 4, in 
import plotly.express as px
File "PyInstaller\loader\pyimod02_importers.py", line 384, in exec_module
File "plotly\express\__init__.py", line 10, in 
ImportError: Plotly Express requires numpy to be installed. You can install numpy using pip with:

$ pip install numpy

Or install Plotly Express and its dependencies directly with:

$ pip install "plotly[express]"

You can also use Plotly Graph Objects to create a large number of charts without installing
numpy. See examples here: https://plotly.com/python/graph-objects/

[PYI-11036:ERROR] Failed to execute script 'main' due to unhandled exception!
< /code>
Ich habe versucht, Numpy und Plotly Express erneut zu installieren, ohne Erfolg (sie wurden korrekt installiert)
Ich habe auch versucht, Numpy direkt in Main.py zu importieren, aber ich erhalte, dass Sie nicht versuchen sollten, Numpy aus dem Quellverzeichnis zu importieren. Modifikation: < /p>
# -*- mode: python ; coding: utf-8 -*-

a = Analysis(
['main.py'],
pathex=[],
binaries=[],
datas=[('c:\\Applications\\MiniForge3.12\\Lib\\site-packages\\plotly', 'plotly')],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)

exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='main',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='main',
)

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post