Background tasks python shell invocation of matplotlib drawing error

In the command window drawing directly run the python script as usual, handed the background task "could not open display" run-time error

Access to information that it may be related to the display window, you need to add two lines of code

import matplotlib as mpl  
mpl.use('Agg')  

Script has been tested and stable operation of a certain time, no other problems.

Guess you like

Origin blog.csdn.net/weixin_34270865/article/details/90864145