Python Installation#
[1]:
import os
from IPython.core.display import HTML
def load_style(directory = '../', name='customMac.css'):
styles = open(os.path.join(directory, name), 'r').read()
return HTML(styles)
load_style()
[1]:
Introduction#
Python is a modern, robust, high level programming language. It is very easy to pick up even if you are completely new to programming.
Installation#
Mac OS X and Linux comes pre installed with python. Windows users can download python from https://www.python.org/downloads/ .
To install IPython run,
$ pip install ipython[all]
This will install all the necessary dependencies for the notebook, qtconsole, tests etc.
Installation from unofficial distributions#
Installing all the necessary libraries might prove troublesome. Anaconda and Canopy comes pre packaged with all the necessary python libraries and also IPython.
Anaconda#
Download Anaconda from https://www.anaconda.com/distribution/
Anaconda is completely free and includes more than 300 python packages. Both python 2.7 and 3.7 options are available.
Anaconda provides excellent binding of packages and their use. Usually I recommend to use virtual environment for any kind of project.
A virtual environment can be created from the terminal using the command
conda create -n yourenvname python=x.x anacondaNote: I personally recommend python 3.6.
Example:
conda create -n myPy36 python=3.6 anacondaIt creates a virtual environment by name
myPy36through anaconda where python 3.6 will be installed along with many basic packages (numpy, scipy, scikit-learn, scikit-image, Pillow, Panda, jupyter, spyder, etc.).Activate virtual environment:
conda activate myPy36Start jupyter-notebook from the terminal:
jupyter notebook
Canopy#
Download Canopy from https://assets.enthought.com/downloads/
Canopy has a premium version which offers 300+ python packages. But the free version works just fine. Canopy supports python 2.7 and 3.6; however, it comes with its own text editor and IPython environment.
Launching IPython Notebook#
From the terminal
ipython-notebook
In Canopy and Anaconda, Open the respective terminals and execute the above.
[ ]: