Installing Python by Miniforge#

There are two major repositories for python and its pakcages:

  • Python Package Index (PyPI): https://pypi.org
    Official repository for python distribution:

  • conda-forge: https://conda-forge.org
    Communit-based repository using conda, an open environment managemnet tool used in Anaconda.

Here we use miniforge that allows you to flexibly set-up enviroments and install Packages.

Using Terminal#

To install python and packages by yourself, you should first start a Terminal, from which you type commands line-by-line.

  • On Linux, Terminal or Console is a standard intreface.

  • On MacOX, you can open Terminal application in the Utiliies folder.

  • On Windows, you can install free Terminal application from MicroSoft Store: https://aka.ms/terminal

Installing conda from miniforge#

Download miniforge from https://conda-forge.org/download/

Then run it using the terminal as described in the download page. On Mac and Linux, it would be:

bash Miniforge3-xx-yy.sh

This installs conda, a standard command for setting up python environments and installing packages.

Setting up an environment by conda#

Before starting installation, it is better to setup a specific environment for each project to allow using the best version of Python and Packages.

For example, we can create an evironment iscicomp by

conda create -n iscicomp

To see what environments are there, you can use

conda env list

and move to one of them by

conda activate iscicomp

Installing python and packages by conda#

Now let us install the latest stable version of python by

conda install python

If you prefer a paricular version of python, you can do, e.g.

conda install python=3.10

Please run python and check that a python of the right version starts up.
You can type >>> exit() to finish python.

Now you can install any other packages as needed. For this book, the following is sufficient:

conda install jupyter notebook jupyterlab numpy matplotlib ipympl scipy scikit-learn