2

我目前正在尝试运行一个 python 脚本,其最终目标是显示一个数字。它的骨骼看起来像:

import matplotlib.pyplot as p

p.figure()

[build figure, create plots]

p.show()

我正在尝试远程运行此脚本。它位于另一台机器上,我试图在从我的笔记本电脑 ssh 时运行它,使用:

$ ssh -X 'myusername'@'myhostname'

但是,每当我执行我的脚本时,我都会收到以下错误,由p.show()

This program needs access to the screen.
Please run with 'pythonw', not 'python', and only when you are logged 
in on the main display of your Mac.

当我使用 pythonw 而不是 python 运行时,我得到了同样的错误。有什么方法可以配置matplotlibssh能够在远程机器上显示或保存绘图文件?

4

0 回答 0