-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Here are a few more things you may like to know:
-
How to set-up an IPython notebook server (mostly for Ubuntu, but can easily be adapted for other Linux distributions or MacOS)
-
Codecademy Basic training in Python
-
To install Python, use the installer found at http://www.python.org/download/releases/2.7.3/
-
Python Extension Packages for Windows: provides unofficial 32- and 64-bit Windows binaries for many scientific open-source extension packages such as NumPy, SciPy, and Matplotlib.
-
Getting IPython Notebook running on Windows 7: Once you've installed IPython, open a Windows command prompt and change to the C:\Python27\Scripts directory. Using easy_install (see link), install the pandas and tornado packages. You will then be able to run Notebook using the Windows command prompt from within the Python27\Scripts directory (but NOT an IPython terminal).
-
You may also be interested in Spyder, and IDE for Python: https://code.google.com/p/spyderlib/
This is a bonus step for more advanced use of IPython. Assuming you have installed all of the above, follow these instructions to set-up a notebook server (adapted from here).
First create a nbserver ipython profile
$ ipython profile create nbserver
Then start an ipython session
$ ipython
And create a hashed password using
In [1]: from IPython.lib import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
Save the hashed password you obtained, then exit ipython and run
$ openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout ipycert.pem -out ipycert.pem
$ sudo mv ipycert.pem /etc/ssl/certs/ipycert.pem
Then open the ~/.config/ipython/profile_nbserver/ipython_notebook_config.py and add the following lines (replace the IP address and hashed password with the relevant information)
c = get_config()
# Kernel config
c.IPKernelApp.pylab = 'inline' # if you want plotting support always
# Notebook config
c.NotebookApp.certfile = u'/etc/ssl/certs/ipycert.pem'
c.NotebookApp.ip = '*' # Replace '*' with your IP (i.e., sd-work0.ece.vt.edu)
c.NotebookApp.open_browser = False
c.NotebookApp.password = u'sha1:bcd259ccf...your hashed password here'
# It's a good idea to put it on a known, fixed port
c.NotebookApp.port = 9999
# Add this for auto-reload
# lines of code to run at IPython startup
c.IPKernelApp.exec_lines = [
'%load_ext autoreload',
'%autoreload 2'
]
To start the notebook, I recommend you create an alias. Open your ~/.bashrc file and add the following line
alias ipython-server='ipython notebook --profile=nbserver'
Finally restart your terminal or source your bashrc.
Now you just have to start the notebook server from the directory where you want your notebooks to be stored. CD into the desired directory and run
$ ipython-server&
You should see a message telling you your notebook server has been started and is accessible at https://your.ip.address:9999. You will have to accept the certificate (as it is self-signed), and enter your password. Then you are good to go!