Python Installation
Before you start
Python together with its Modules Scipy, Numpy and Matplotlib are used in a couple of courses in Numerical Analysis in Lund.
Here we advise how to install and run Python on your home computer. We work with Python versions 3.*, e.g. Python 3.7. Note that there are differences between Python 2.* and Python 3.* which may make some of the examples in our courses not work correctly if you have the wrong (old) version of Python installed. Before you install check if your system uses a 64 bit operative system or a 32 bit system. Most modern computers work with a 64 bit system.
Installation
It is expected that you install Python from the Anaconda Scientific Python Distribution - even if you have already another installation of Python on your computer. Anaconda gives you independent access to Python without side-effects on other installations. It includes all modules you might need for scientific computing and the workbench (editor) Spyder. Download the installer here Links to an external site. and follow the platform-specific installation instructions on the download page. The distribution is free, but you have to provide your e-mail address.
Configuration of Spyder
- Open Spyder and go to Tools --> Preferences --> Global Working Directory
Give the details about the directory you use to work in. - Open Spyder and go to Tools --> Preferences --> Editor --> Advanced Settings
Select Edit templates for new Modules
The template file will be opened. Modify it so that it looks like# -*- coding: utf-8 -*- """ Created on %(date)s @author: %(username)s """ from numpy import * from matplotlib.pyplot import *
- Open Spyder and go to Tools --> Preferences --> IPython console --> Startup
an change the Run code section as in the following picture: