2
votes

By following the tutorial from Running an iPython Notebook Server on AWS - EC2 Instance

I successfully configured the ipython notebook server on AWS EC2 instance, also I found that to use matplotlib module I have to ssh -X to the instance and then run:

nohup ipython notebook --profile=nbserver

and then set

%matplotlib inline

in the ipython notebook connected through https in the browser.

Now I want to automate the whole process so that I can directly open the browser to use the ipython notebook when starting an instance, just like the RStudio AMI created by Louis Aslett, so I tried:

crontab -e

then I add the following line to the end of this file

@reboot nohup ipython notebook --profile=nbserver

But but when I reboot this instance this command won't work. Also I don't know how to enable X11 forward in the start up script so that I can use matplotlib to plot. Can someone help me with this configuration?

1

1 Answers

0
votes

Cron doesn't know your environment variables. So when you run ipython, it doesn't know where to find it from. To resolve;

First type

which ipython

then change this with the ipython part of your code

@reboot nohup /home/ubuntu/anaconda/bin/ipython notebook --profile=nbserver