Problem running python/matplotlib in background after ending ssh session

后端 未结 4 578
长发绾君心
长发绾君心 2020-12-24 07:50

I have to VPN and then ssh from home to my work server and want to run a python script in the background, then log out of the ssh session. My script makes several histogram

4条回答
  •  醉话见心
    2020-12-24 08:29

    I believe your matplotlib backend requires X11. Look in your matplotlibrc file to determine what your default is (from the error, I'm betting TkAgg). To run without X11, use the Agg backend. Either set it globally in the matplotlibrc file or on a script by script by adding this to the python program:

    import matplotlib
    matplotlib.use('Agg')
    

提交回复
热议问题