【发布时间】:2018-05-02 23:04:04
【问题描述】:
我遇到了一个问题,即尝试使用导入的 matplotlib 分离远程、活动的 IPython 会话(通过 Tmux),然后注销 SSH 挂起。我必须 Crtl-C 来终止该进程。当我 SSH 回到机器时,tmux 进程消失了。
IPython 示例:
~$ ssh-desk # ssh into remote machine
~$ tmux
~$ ipython
In [1]: import matplotlib.pyplot as plt
Crtl-b Crtl-b d
[detached (from session 0)]
~$ tmux ls
0: 1 windows (created Wed May 2 16:52:58 2018) [78x38]
~$ exit
logout
(process hangs here)
Ctrl-c
~$ ssh-desk
~$ tmux ls
no server running on /tmp/tmux-1000/default
我确实收到过关于 X11 会话被终止的错误。我认为这是因为我使用 ssh -Y 将 X11 转发用于图形。
The X11 connection broke (error 1). Did the X11 server die?
有没有办法在 IPython/Python 中运行 matplotlib 并成功分离 tmux 会话并注销?
我使用的是 Linux Mint 18.3(本地和远程机器),IPython 6.3.1
更新 我已经搜索了所有可能的解决方案,以使用 X11 转发分离 tmux 会话,但无法使其工作,包括将一些 DISPLAY 代码放入 .bashrc 文件中。我也尝试使用 xpra,但出现找不到模块 rencode 的错误。
【问题讨论】:
标签: matplotlib ssh ipython tmux