I'd like to use iPython on an Amazon EC2 (Linux AMI). I've installed Anaconda and started iPython to test out some scripts I've already created. Right now I am only interested in running it in Terminal (not as Notebook).
At the beginning of my code I always do:
import json
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
However, I tried CTRL + C from my text editor and then using %paste in Terminal I get the error:
TclError: no display name and no $DISPLAY environment variable
If I try to ssh -X name@host as per this suggestion No display name and no $DISPLAY environment variable using tkinter through ssh, I get:
/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
To fix that issue I tried https://superuser.com/questions/249045/x11-forwarding-from-amazon-ec2-ami but still got a warning:
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
And the same error:
TclError: no display name and no $DISPLAY environment variable
Per this suggestion Generating a PNG with matplotlib when DISPLAY is undefined (which seems irrelevant but I've tried everything) I did:
import matplotlib
matplotlib.use('Agg')
before importing anything else and still get the same error.
Any ideas on how to solve this problem? I'd really like to use the paste magic function to input functions/etc.
TclError): # happens when numeric fields are empty. return '' Example #4. Source Project: Python-GUI-Programming-with-Tkinter Author: PacktPublishing File: widgets.py License: MIT License. 6 votes.
This is more of a linux/X11 issue than a python question. Also, this process will probably be overkill - you'd be better just running ipython locally or launching a web notebook.
Anyway, you should:
You should then be able to start ipython and use %paste.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With