We require you to have a laptop for the practical exercises. If you do not have one, or want to borrow one from us, please contact nina.norgren@scilifelab.se before the beginning of the course.
It is important to come prepared before the first lecture, in order to fully take advantage of the hands-on exercises, coming at a rather high pace.
We have the 3 following requirements:
- Install Python on your machine (obviously),
- Make sure you have a proper text editor
- Check that the installation went fine, by running a given simple script,
How to install Python
Please, choose to install the version 3.6.0
or above. The latest version available is 3.7.0
On Windows
Here are the installation steps on Windows. The installer should look like:
On Mac OS X
Since Mac OS X 10.8, Python 2.7 is pre-installed by Apple. This is an incompatible version with this course. You should instead download the installer for the version 3.7.0, double-click and follow the instructions.
More information can be found on docs.python.org/3.7
IMPORTANT NOTE: If you are not interested in a system-wide version of Python3, you can use
pyenv
to easily switch between multiple versions of Python. You can install pyenv from GitHub. After installation, you can install version 3.7.0 by issuing the following command in your Terminal.$ pyenv install 3.7.0
On Linux/Unix
Using a package manager
Install Python3 and pip using your package manager. For Ubuntu and Debian, it goes like this:
sudo apt-get update
sudo apt-get install python3 python3-pip
Then use pip to install Jupyter (see [below](#jupyter) for more details).
sudo python3 -m pip install jupyter
You can also use pip to install Biopython:
sudo python3 -m pip install biopython
#### Installing from source
You can also install [Python from source](https://www.python.org/downloads/).
A note for Linux/Unix and Mac users
The command to run Python is python3
. If you wish to be able to start Python by typing just python
,
add the following line to the file ~/.bashrc
(or ~/.bash_profile
):
alias python=python3
Using a proper Text Editor
We are going to type (a lot of) Python code, so you’d better have a good text editor. This is useful for several reasons: The text editor can highlight the Python keywords and handles the particulars regarding tabulations (which we will introduce in the course).
Testing your installation
Start your favorite terminal and check the Python version. Type at the
prompt (ie where the $
sign is):
$ python3 --version
or start the python interpretor
$ python3
Running a test script
Download this test script (from the NBIS GitHub location for this instance of the course), and in your terminal, run
$ python3 test.py
…in the folder where the script resides. If this works fine, you should see the current time printed with “big digits” ;)
Jupyter notebooks
In the course, we will write Python code as standalone files. However, during the lecture, we will also use Jupyter notebooks. Jupyter is a web-based tool which allows us to evaluate our code line by line. The Jupyter files are called notebooks and will serve a single purpose in this course: a quick demonstration of Python code. It is therefore convenient, though optional, to install Jupyter in advance.
Impatient about the first lecture?
Whet your appetite on the Python tutorial or an informal introduction to Python.