backtrader+pyqt5 beim Importieren einer Qt-Anwendung nach backtrader-Imort

in #proofofbrain3 years ago (edited)

import backtrader as bt
import hauptfenster #Qt-Anwendung

Traceback (most recent call last):
File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, *self._kwargs)
File "/home/dev/.Trash-7/files/Projekte/graph_backtrader.py", line 65, in run_backtrader
preload=True
File "/usr/local/lib/python3.7/dist-packages/backtrader/cerebro.py", line 996, in plot
plotter.show()
File "/usr/local/lib/python3.7/dist-packages/backtrader/plot/plot.py", line 814, in show
self.mpyplot.show()
File "/usr/local/lib/python3.7/dist-packages/matplotlib/pyplot.py", line 353, in show
return _backend_mod.show(
args, *kwargs)
File "/usr/local/lib/python3.7/dist-packages/matplotlib/backends/backend_nbagg.py", line 253, in show
manager.show()
File "/usr/local/lib/python3.7/dist-packages/matplotlib/backends/backend_nbagg.py", line 89, in show
self._create_comm()
File "/usr/local/lib/python3.7/dist-packages/matplotlib/backends/backend_nbagg.py", line 121, in _create_comm
self.add_web_socket(comm)
File "/usr/local/lib/python3.7/dist-packages/matplotlib/backends/backend_webagg_core.py", line 445, in add_web_socket
self.resize(
self.canvas.figure.bbox.size)
File "/usr/local/lib/python3.7/dist-packages/matplotlib/backends/backend_webagg_core.py", line 434, in resize
forward=forward)
File "/usr/local/lib/python3.7/dist-packages/matplotlib/backends/backend_webagg_core.py", line 502, in _send_event
s.send_json(payload)
File "/usr/local/lib/python3.7/dist-packages/matplotlib/backends/backend_nbagg.py", line 197, in send_json
self.comm.send({'data': json.dumps(content)})
File "/usr/local/lib/python3.7/dist-packages/ipykernel/comm/comm.py", line 123, in send
data=data, metadata=metadata, buffers=buffers,
File "/usr/local/lib/python3.7/dist-packages/ipykernel/comm/comm.py", line 66, in _publish_msg
self.kernel.session.send(self.kernel.iopub_socket, msg_type,
AttributeError: 'NoneType' object has no attribute 'session'

Versionsnummer: matplotlib 3.3.4

Ich musste das Problem aus Zeitgründen umgehen, und habe dafür
from multiprocessing.connection import Client, from multiprocessing.connection import Listener verwendet.