3
與matplotlib.pyplot問題,當我在IPython中關於Python 3.5通過SSH運行matplotlib.pyplot,我收到此錯誤信息,我不知道該用它來做什麼。有通過ssh
In [1]: import matplotlib
In [2]: from matplotlib import pyplot
Jan 13 10:24:14 python[66770] <Error>: Set a breakpoint at CGSLogError to catch errors as they are logged.
Jan 13 10:24:14 python[66770] <Error>: This user is not allowed access to the window system right now.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
Jan 13 10:24:15 python[66770] <Warning>: CGSConnectionByID: 0 is not a valid connection ID.
Jan 13 10:24:15 python[66770] <Warning>: CGSConnectionByID: 0 is not a valid connection ID.
Jan 13 10:24:15 python[66770] <Warning>: CGSConnectionByID: 0 is not a valid connection ID.
Jan 13 10:24:15 python[66770] <Warning>: CGSConnectionByID: 0 is not a valid connection ID.
Jan 13 10:24:15 python[66770] <Warning>: CGSConnectionByID: 0 is not a valid connection ID.
Jan 13 10:24:15 python[66770] <Warning>: CGSConnectionByID: 0 is not a valid connection ID.
Jan 13 10:24:15 python[66770] <Warning>: Invalid Connection ID 0
我試圖通過完全重新安裝蟒蛇Python和所有的包分別使用PIP 3安裝。有什麼想法嗎?
乍一看,它看起來像你試圖在不啓用X轉發SSH連接使用交互式後端。如果你不想交互圖,然後用非交互式後端(例如'進口matplotlib; matplotlib.use(「此Agg」);按照這個順序進口matplotlib.pyplot')。如果您想使用交互式後端,請嘗試使用'ssh -X'或類似的東西進行連接。 –
使用import matplotlib; matplotlib.use( '此Agg');進口matplotlib.pyplot精美工作......太感謝你了,你增加了世界的淨快樂。 –