【发布时间】:2015-05-08 11:13:25
【问题描述】:
我想在 Amazon EC2 (Linux AMI) 上使用 iPython。我已经安装了 Anaconda 并启动了 iPython 来测试我已经创建的一些脚本。现在我只对在终端中运行它感兴趣(不是作为笔记本)。
在我的代码开头我总是这样做:
import json
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
但是,我在我的文本编辑器中尝试了 CTRL + C,然后在终端中使用 %paste 我得到了错误:
TclError: no display name and no $DISPLAY environment variable
如果我按照这个建议 No display name and no $DISPLAY environment variable using tkinter through ssh 尝试 ssh -X name@host,我会得到:
/opt/X11/bin/xauth: file /Users/adrianp/.Xauthority does not exist
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
X11 forwarding request failed on channel 0
为了解决这个问题,我尝试了https://superuser.com/questions/249045/x11-forwarding-from-amazon-ec2-ami,但仍然收到警告:
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
同样的错误:
TclError: no display name and no $DISPLAY environment variable
根据这个建议Generating a PNG with matplotlib when DISPLAY is undefined(这似乎无关紧要,但我已经尝试了一切)我做了:
import matplotlib
matplotlib.use('Agg')
在导入其他任何内容之前仍然会出现相同的错误。
关于如何解决这个问题的任何想法?我真的很想使用粘贴魔术功能来输入功能/等。
【问题讨论】:
-
尝试使用魔术粘贴功能时的另一个变化是
TclError: couldn't connect to display "localhost:10.0" -
关于 localhost 错误...试过了,但仍然无法使用魔法粘贴 stackoverflow.com/questions/2443702/…
-
这似乎是一个 IPython 3.0 错误,FWIW 我在 ARM 服务器上遇到了同样的问题
标签: python amazon-ec2 ipython anaconda