PyEval_RestoreThread: NULL tstate on plot.show()

0
import sys
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

def plot(simulation, thresholds, simtime):
   fig1, (ax1, ax2, ax3) = plt.subplots(3, 1, sharex=True)

   fig1.set_size_inches(8, 6, forward=True)
   fig1.show()

I tried this simple code in order to open a plot in python. But everytime I execute the programm I get the following error: Fatal Python error: PyEval_RestoreThread: NULL tstate. My python version is 3.7.0. I installed matplotlib using this command: pip install matplotlib

My entire traceback:

Fatal Python error: PyEval_RestoreThread: NULL tstate

Thread 0x000036e8 (most recent call first):
File "c:\Users\noname\.vscode\extensions\ms-python.python-2018.7.1\pythonFiles\PythonTools\visualstudio_py_util.py", line 137 in read_bytes
File "c:\Users\noname\.vscode\extensions\ms-python.python-2018.7.1\pythonFiles\PythonTools\visualstudio_py_debugger.py", line 1726 in loop

Current thread 0x00003a1c (most recent call first):
File "c:\Users\noname\Desktop\Software\source\core.py", line 242 in main
File "c:\Users\noname\Desktop\Software\source\core.py", line 245 in <module>
File "c:\Users\noname\.vscode\extensions\ms-python.python-2018.7.1\pythonFiles\PythonTools\visualstudio_py_util.py", line 95 in exec_code
File "c:\Users\noname\.vscode\extensions\ms-python.python-2018.7.1\pythonFiles\PythonTools\visualstudio_py_util.py", line 119 in exec_file
File "c:\Users\noname\.vscode\extensions\ms-python.python-2018.7.1\pythonFiles\PythonTools\visualstudio_py_debugger.py", line 2625 in debug
File "c:\Users\noname\.vscode\extensions\ms-python.python-2018.7.1\pythonFiles\PythonTools\visualstudio_py_launcher.py", line 91 in <module>
python
matplotlib
asked on Stack Overflow Aug 21, 2018 by kokos123 • edited Sep 29, 2020 by Tibebes. M

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0