From f18b3c0ab536e1d6ce56f8916479f2a092a8a423 Mon Sep 17 00:00:00 2001 From: Dmitry Nikolaenko Date: Thu, 6 Nov 2025 00:33:42 +0000 Subject: [PATCH 1/4] Add bonus text to work with - to be reworked and inserted in Jupyter Notebook --- installing_python.md | 78 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 installing_python.md diff --git a/installing_python.md b/installing_python.md new file mode 100644 index 0000000..4fe9b51 --- /dev/null +++ b/installing_python.md @@ -0,0 +1,78 @@ +# Bonus chapter + +## How to run python on your own computer + +If you wish to run exercise locally, you can certainly install Python and Jupyter interactive notebook on your own laptop, see the installation instructions below. + +### Installing Python + +#### On Windows: + +1. Go to https://www.python.org/downloads/) and choose the latest stable installer for Windows (for example, “Windows installer (64-bit)”). +2. During installation, make sure to check the box “Add Python to PATH” so you can use Python from any command prompt. +3. After installation finishes, open a new Terminal (Command Prompt or PowerShell) and type: + +``` +python --version +``` + +This should confirm that Python installed successfully. + + - Alternatively, you could install the Anaconda distribution from https://www.anaconda.com/products/distribution, which includes Python and a variety of data-science packages by default. + +#### On Linux (Ubuntu/Debian-based): + +1. Open a terminal. +2. Run: +``` +sudo apt-get update +sudo apt-get install python3 python3-pip +``` +(Adjust to python or python3 depending on your distribution) + +1. Confirm your installation by running: +``` +python3 --version +``` + + - For Fedora or other distributions, replace `apt-get` with `yum`, `dnf`, or your distro’s package manager. + - You can also install Anaconda if you want a more complete environment. + + +#### On macOS: + +1. Visit https://www.python.org/downloads/ and download the macOS installer (e.g., “macOS 64-bit universal2 installer”). +2. Double-click the `.pkg` file and follow the prompts. +3. After installation, open Terminal and check: +``` +python3 --version +``` + + - Alternatively, on macOS you can install Python via Homebrew (if you already have Homebrew installed) by running: +``` +brew install python3 +``` + +#### Installing and Running Jupyter Notebooks + +1. Once Python is installed (whether from python.org, your Linux package manager, or Anaconda), you can install Jupyter Notebook as follows: +``` +pip install jupyter +``` + +Or Jupyter Lab, the next-generation web-based interface for the Jupyter project (which I'll be using) +``` +pip install jupyterlab +``` +(Use `pip3` if needed, e.g., › `pip3 install jupyter`) • If you chose Anaconda, Jupyter Notebook is already included, so you can skip this step. + +2. When everything is installed, you can start a Jupyter notebook server (or Jupyter Lab) and work on your Python exercises by simply running in your terminal or command prompt: +``` +jupyter notebook +``` +or +``` +jupyter lab +``` + +This will open a new tab in your web browser with the Jupyter Notebook or Jupyter Lab interface, ready for you to start coding! \ No newline at end of file From 79768bb9a7671d874c8752c3b751a677aa737e46 Mon Sep 17 00:00:00 2001 From: Dmitry Nikolaenko Date: Thu, 6 Nov 2025 09:30:02 +0000 Subject: [PATCH 2/4] Add appendix about installing python only Basic_filled.ipynb edited the unfilled version in the next commit (still untested how it actually looks in presentation mode, might already works fine) --- Basics.ipynb | 170 +++++++++++++++++++++++++++++++++++++++++++- Basics_filled.ipynb | 148 +++++++++++++++++++++++++++++++++++++- 2 files changed, 312 insertions(+), 6 deletions(-) diff --git a/Basics.ipynb b/Basics.ipynb index 2efd5b9..ba388cd 100644 --- a/Basics.ipynb +++ b/Basics.ipynb @@ -2916,12 +2916,176 @@ }, { "cell_type": "markdown", - "id": "3ebab575", + "id": "fb1b118c", "metadata": { "editable": false }, "source": [ - "" + "# **Appendix**" + ] + }, + { + "cell_type": "markdown", + "id": "96d9f8ac", + "metadata": { + "editable": false + }, + "source": [ + "## How to run python on your own computer" + ] + }, + { + "cell_type": "markdown", + "id": "2682a9ea", + "metadata": { + "editable": false + }, + "source": [ + "If you wish to run exercise locally, you can certainly install Python and Jupyter interactive notebook on your own laptop, see the installation instructions below." + ] + }, + { + "cell_type": "markdown", + "id": "9bf355f1", + "metadata": { + "editable": false + }, + "source": [ + "### Installing Python" + ] + }, + { + "cell_type": "markdown", + "id": "d0b30d43", + "metadata": { + "editable": false + }, + "source": [ + "#### On Windows:" + ] + }, + { + "cell_type": "markdown", + "id": "e0a9656c", + "metadata": { + "editable": false + }, + "source": [ + "1. Go to https://www.python.org/downloads/) and choose the latest stable installer for Windows (for example, \u201cWindows installer (64-bit)\u201d).\n", + "2. During installation, make sure to check the box \u201cAdd Python to PATH\u201d so you can use Python from any command prompt.\n", + "3. After installation finishes, open a new Terminal (Command Prompt or PowerShell) and type:\n", + "\n", + "```python\n", + "python --version\n", + "```\n", + "\n", + "This should confirm that Python installed successfully.\n", + "\n", + " - Alternatively, you could install the Anaconda distribution from https://www.anaconda.com/products/distribution, which includes Python and a variety of data-science packages by default." + ] + }, + { + "cell_type": "markdown", + "id": "b03e4874", + "metadata": { + "editable": false + }, + "source": [ + "#### On Linux (Ubuntu/Debian-based):" + ] + }, + { + "cell_type": "markdown", + "id": "546d664c", + "metadata": { + "editable": false + }, + "source": [ + "1. Open a terminal.\n", + "2. Run:\n", + "```\n", + "sudo apt-get update\n", + "sudo apt-get install python3 python3-pip\n", + "```\n", + "(Adjust to python or python3 depending on your distribution)\n", + "\n", + "3. Confirm your installation by running:\n", + "```python\n", + "python3 --version\n", + "```\n", + "\n", + " - For Fedora or other distributions, replace `apt-get` with `yum`, `dnf`, or your distro\u2019s package manager.\n", + " - You can also install Anaconda if you want a more complete environment." + ] + }, + { + "cell_type": "markdown", + "id": "d25e9eaa", + "metadata": { + "editable": false + }, + "source": [ + "#### On macOS:" + ] + }, + { + "cell_type": "markdown", + "id": "32384276", + "metadata": { + "editable": false + }, + "source": [ + "1. Visit https://www.python.org/downloads/ and download the macOS installer (e.g., \u201cmacOS 64-bit universal2 installer\u201d).\n", + "2. Double-click the `.pkg` file and follow the prompts.\n", + "3. After installation, open Terminal and check:\n", + "```\n", + "python3 --version\n", + "```\n", + "\n", + " - Alternatively, on macOS you can install Python via Homebrew (if you already have Homebrew installed) by running:\n", + "```\n", + "brew install python3\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "6ad36f9c", + "metadata": { + "editable": false + }, + "source": [ + "#### Installing and Running Jupyter Notebooks" + ] + }, + { + "cell_type": "markdown", + "id": "88323ba7", + "metadata": { + "editable": false + }, + "source": [ + "1. Once Python is installed (whether from python.org, your Linux package manager, or Anaconda), you can install Jupyter Notebook as follows:\n", + "```\n", + "pip install jupyter\n", + "```\n", + "\n", + "Or Jupyter Lab, the next-generation web-based interface for the Jupyter project (which I'll be using)\n", + "```\n", + "pip install jupyterlab\n", + "```\n", + "(Use `pip3` if needed, e.g., \u203a `pip3 install jupyter`) \u2022 If you chose Anaconda, Jupyter Notebook is already included, so you can skip this step.\n", + "\n", + "2. When everything is installed, you can start a Jupyter notebook server (or Jupyter Lab) and work on your Python exercises by simply running in your terminal or command prompt:\n", + "```\n", + "jupyter notebook\n", + "```\n", + "or\n", + "```\n", + "jupyter lab\n", + "```\n", + "\n", + "This will open a new tab in your web browser with the Jupyter Notebook or Jupyter Lab interface, ready for you to start coding!" ] } ], @@ -2941,7 +3105,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.3" + "version": "3.13.0" } }, "nbformat": 4, diff --git a/Basics_filled.ipynb b/Basics_filled.ipynb index 2cad84b..d02ca9f 100644 --- a/Basics_filled.ipynb +++ b/Basics_filled.ipynb @@ -3514,10 +3514,152 @@ }, { "cell_type": "markdown", - "id": "3ebab575", + "id": "fb1b118c", "metadata": {}, "source": [ - "" + "# **Appendix**" + ] + }, + { + "cell_type": "markdown", + "id": "96d9f8ac", + "metadata": {}, + "source": [ + "## How to run python on your own computer" + ] + }, + { + "cell_type": "markdown", + "id": "2682a9ea", + "metadata": {}, + "source": [ + "If you wish to run exercise locally, you can certainly install Python and Jupyter interactive notebook on your own laptop, see the installation instructions below." + ] + }, + { + "cell_type": "markdown", + "id": "9bf355f1", + "metadata": {}, + "source": [ + "### Installing Python" + ] + }, + { + "cell_type": "markdown", + "id": "d0b30d43", + "metadata": {}, + "source": [ + "#### On Windows:" + ] + }, + { + "cell_type": "markdown", + "id": "e0a9656c", + "metadata": {}, + "source": [ + "1. Go to https://www.python.org/downloads/) and choose the latest stable installer for Windows (for example, “Windows installer (64-bit)”).\n", + "2. During installation, make sure to check the box “Add Python to PATH” so you can use Python from any command prompt.\n", + "3. After installation finishes, open a new Terminal (Command Prompt or PowerShell) and type:\n", + "\n", + "```python\n", + "python --version\n", + "```\n", + "\n", + "This should confirm that Python installed successfully.\n", + "\n", + " - Alternatively, you could install the Anaconda distribution from https://www.anaconda.com/products/distribution, which includes Python and a variety of data-science packages by default." + ] + }, + { + "cell_type": "markdown", + "id": "b03e4874", + "metadata": {}, + "source": [ + "#### On Linux (Ubuntu/Debian-based):" + ] + }, + { + "cell_type": "markdown", + "id": "546d664c", + "metadata": {}, + "source": [ + "1. Open a terminal.\n", + "2. Run:\n", + "```\n", + "sudo apt-get update\n", + "sudo apt-get install python3 python3-pip\n", + "```\n", + "(Adjust to python or python3 depending on your distribution)\n", + "\n", + "3. Confirm your installation by running:\n", + "```python\n", + "python3 --version\n", + "```\n", + "\n", + " - For Fedora or other distributions, replace `apt-get` with `yum`, `dnf`, or your distro’s package manager.\n", + " - You can also install Anaconda if you want a more complete environment." + ] + }, + { + "cell_type": "markdown", + "id": "d25e9eaa", + "metadata": {}, + "source": [ + "#### On macOS:" + ] + }, + { + "cell_type": "markdown", + "id": "32384276", + "metadata": {}, + "source": [ + "1. Visit https://www.python.org/downloads/ and download the macOS installer (e.g., “macOS 64-bit universal2 installer”).\n", + "2. Double-click the `.pkg` file and follow the prompts.\n", + "3. After installation, open Terminal and check:\n", + "```\n", + "python3 --version\n", + "```\n", + "\n", + " - Alternatively, on macOS you can install Python via Homebrew (if you already have Homebrew installed) by running:\n", + "```\n", + "brew install python3\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "6ad36f9c", + "metadata": {}, + "source": [ + "#### Installing and Running Jupyter Notebooks" + ] + }, + { + "cell_type": "markdown", + "id": "88323ba7", + "metadata": {}, + "source": [ + "1. Once Python is installed (whether from python.org, your Linux package manager, or Anaconda), you can install Jupyter Notebook as follows:\n", + "```\n", + "pip install jupyter\n", + "```\n", + "\n", + "Or Jupyter Lab, the next-generation web-based interface for the Jupyter project (which I'll be using)\n", + "```\n", + "pip install jupyterlab\n", + "```\n", + "(Use `pip3` if needed, e.g., › `pip3 install jupyter`) • If you chose Anaconda, Jupyter Notebook is already included, so you can skip this step.\n", + "\n", + "2. When everything is installed, you can start a Jupyter notebook server (or Jupyter Lab) and work on your Python exercises by simply running in your terminal or command prompt:\n", + "```\n", + "jupyter notebook\n", + "```\n", + "or\n", + "```\n", + "jupyter lab\n", + "```\n", + "\n", + "This will open a new tab in your web browser with the Jupyter Notebook or Jupyter Lab interface, ready for you to start coding!" ] } ], @@ -3537,7 +3679,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.3" + "version": "3.13.0" } }, "nbformat": 4, From caa295156bc174c1b351da04608dd765f927a049 Mon Sep 17 00:00:00 2001 From: Niolon Date: Thu, 6 Nov 2025 10:58:27 +0000 Subject: [PATCH 3/4] Added comparison table and instructions for conda --- Basics.ipynb | 206 +++++++++++++++++++++++++++++++++++++++++--- Basics_filled.ipynb | 186 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 366 insertions(+), 26 deletions(-) diff --git a/Basics.ipynb b/Basics.ipynb index ba388cd..b998b94 100644 --- a/Basics.ipynb +++ b/Basics.ipynb @@ -2921,27 +2921,39 @@ "editable": false }, "source": [ - "# **Appendix**" + "# **Appendix: Running python locally**" ] }, { "cell_type": "markdown", - "id": "96d9f8ac", + "id": "d029a1c0", "metadata": { "editable": false }, "source": [ - "## How to run python on your own computer" + "To run python outside of the JupyterLite environment you need to install it locally. As with a lot of large programming languages there are multiple solutions to do this. The two common families of solutions are python with pip and conda/mamba." ] }, { "cell_type": "markdown", - "id": "2682a9ea", + "id": "e8556ab8", "metadata": { "editable": false }, "source": [ - "If you wish to run exercise locally, you can certainly install Python and Jupyter interactive notebook on your own laptop, see the installation instructions below." + "| Feature | **Python with pip** | **Conda/Mamba** |\n", + "|---------|----------------|-----------------|\n", + "| **Installation** | Install Python from python.org, pip included | Install Anaconda/Miniconda distribution |\n", + "| **Package Management** | `pip install package` | `conda install package` or `mamba install package` |\n", + "| **Environment Management** | `venv` or `virtualenv` (separate tools) | Built-in: `conda create -n myenv` |\n", + "| **Package Repository** | PyPI (Python Package Index) | Anaconda repository + conda-forge |\n", + "| **Non-Python Dependencies** | Limited (Python packages only) | Excellent (handles Python, R, C libraries, etc.) |\n", + "| **Complexity** | Simpler, more lightweight | More comprehensive, heavier |\n", + "| **Best For** | Pure Python development, simple projects | Data science, scientific computing, complex dependencies |\n", + "| **Speed** | Fast package installation | Slower (conda), faster with mamba |\n", + "| **Architecture Support** | Excellent (source packages work on any architecture, if compiling tools available) | Limited to pre-built binaries for common architectures |\n", + "| **Reproducibility** | `requirements.txt` | `environment.yml` with exact versions |\n", + "| **Modern Tooling** | **uv** (ultra-fast installer), **Poetry** (dependency & packaging) | **Mamba** (faster conda drop-in replacement), **Pixi** (modern project/workflow tool) |" ] }, { @@ -2951,7 +2963,7 @@ "editable": false }, "source": [ - "### Installing Python" + "### Installing Python and pip" ] }, { @@ -3065,16 +3077,11 @@ "editable": false }, "source": [ - "1. Once Python is installed (whether from python.org, your Linux package manager, or Anaconda), you can install Jupyter Notebook as follows:\n", - "```\n", - "pip install jupyter\n", - "```\n", - "\n", - "Or Jupyter Lab, the next-generation web-based interface for the Jupyter project (which I'll be using)\n", + "1. Once Python is installed (whether from python.org, your Linux package manager, or Anaconda), you can install Jupyter Lab as follows:\n", "```\n", "pip install jupyterlab\n", "```\n", - "(Use `pip3` if needed, e.g., \u203a `pip3 install jupyter`) \u2022 If you chose Anaconda, Jupyter Notebook is already included, so you can skip this step.\n", + "(Use `pip3` if needed, e.g., \u203a `pip3 install jupyter`)\n", "\n", "2. When everything is installed, you can start a Jupyter notebook server (or Jupyter Lab) and work on your Python exercises by simply running in your terminal or command prompt:\n", "```\n", @@ -3087,6 +3094,179 @@ "\n", "This will open a new tab in your web browser with the Jupyter Notebook or Jupyter Lab interface, ready for you to start coding!" ] + }, + { + "cell_type": "markdown", + "id": "1ea7de96", + "metadata": { + "editable": false + }, + "source": [ + "### Installing Mamba (via Miniforge)" + ] + }, + { + "cell_type": "markdown", + "id": "88f8fa02", + "metadata": { + "editable": false + }, + "source": [ + "#### On Windows:" + ] + }, + { + "cell_type": "markdown", + "id": "bc5d5add", + "metadata": { + "editable": false + }, + "source": [ + "1. Go to https://github.com/conda-forge/miniforge and download the Miniforge3 installer for Windows (e.g., \"Miniforge3-Windows-x86_64.exe\").\n", + "2. Run the installer and follow the prompts. You can accept the default options.\n", + "3. After installation, open \"Miniforge Prompt\" from the Start menu and verify:\n", + "\n", + "```bash\n", + "mamba --version\n", + "conda --version\n", + "```\n", + "\n", + "This should confirm that Mamba and Conda are installed successfully.\n", + "\n", + " - Miniforge comes with `mamba` pre-installed and uses conda-forge as the default channel." + ] + }, + { + "cell_type": "markdown", + "id": "a9daafa9", + "metadata": { + "editable": false + }, + "source": [ + "#### On Linux (Ubuntu/Debian-based and others):" + ] + }, + { + "cell_type": "markdown", + "id": "ba271553", + "metadata": { + "editable": false + }, + "source": [ + "1. Open a terminal and download the installer:\n", + "```bash\n", + "wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh\n", + "```\n", + "\n", + "2. Run the installer:\n", + "```bash\n", + "bash Miniforge3-Linux-x86_64.sh\n", + "```\n", + "\n", + "3. Follow the prompts, accept the license, and allow the installer to initialize Miniforge.\n", + "\n", + "4. Restart your terminal or run:\n", + "```bash\n", + "source ~/.bashrc\n", + "```\n", + "\n", + "5. Confirm your installation:\n", + "```bash\n", + "mamba --version\n", + "conda --version\n", + "```\n", + "\n", + " - For ARM-based systems, download `Miniforge3-Linux-aarch64.sh` instead." + ] + }, + { + "cell_type": "markdown", + "id": "f2e714e4", + "metadata": { + "editable": false + }, + "source": [ + "#### On macOS:" + ] + }, + { + "cell_type": "markdown", + "id": "232aee40", + "metadata": { + "editable": false + }, + "source": [ + "1. Download the installer from https://github.com/conda-forge/miniforge:\n", + " - For Intel Macs: `Miniforge3-MacOSX-x86_64.sh`\n", + " - For Apple Silicon (M1/M2/M3): `Miniforge3-MacOSX-arm64.sh`\n", + "\n", + "2. Open Terminal and navigate to your Downloads folder, then run:\n", + "```bash\n", + "bash Miniforge3-MacOSX-*.sh\n", + "```\n", + "(Replace `*` with `x86_64` or `arm64` depending on your system)\n", + "\n", + "3. Follow the installation prompts and allow the installer to initialize Miniforge.\n", + "\n", + "4. Restart your terminal or run:\n", + "```bash\n", + "source ~/.bash_profile # or ~/.zshrc if using zsh\n", + "```\n", + "\n", + "5. Verify the installation:\n", + "```bash\n", + "mamba --version\n", + "conda --version\n", + "```\n", + "\n", + " - Alternatively, if you have Homebrew installed, you can run:\n", + "```bash\n", + "brew install --cask miniforge\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "68d32a65", + "metadata": { + "editable": false + }, + "source": [ + "#### Installing and Running Jupyter Notebooks with Mamba" + ] + }, + { + "cell_type": "markdown", + "id": "38068a3a", + "metadata": { + "editable": false + }, + "source": [ + "1. Once Miniforge/Mamba is installed, you can install JupyterLab in a new environment for your project:\n", + "```bash\n", + "mamba create -n myproject python=3.11 jupyterlab\n", + "mamba activate myproject\n", + "```\n", + "\n", + "2. Start Jupyter:\n", + "```bash\n", + "jupyter notebook\n", + "```\n", + "or\n", + "```bash\n", + "jupyter lab\n", + "```\n", + "\n", + "This will open a new tab in your web browser with the Jupyter interface, ready for you to start coding!" + ] + }, + { + "cell_type": "markdown", + "id": "ac3d4b98", + "metadata": { + "editable": false + }, + "source": [] } ], "metadata": { diff --git a/Basics_filled.ipynb b/Basics_filled.ipynb index d02ca9f..961da39 100644 --- a/Basics_filled.ipynb +++ b/Basics_filled.ipynb @@ -3517,23 +3517,35 @@ "id": "fb1b118c", "metadata": {}, "source": [ - "# **Appendix**" + "# **Appendix: Running python locally**" ] }, { "cell_type": "markdown", - "id": "96d9f8ac", + "id": "d029a1c0", "metadata": {}, "source": [ - "## How to run python on your own computer" + "To run python outside of the JupyterLite environment you need to install it locally. As with a lot of large programming languages there are multiple solutions to do this. The two common families of solutions are python with pip and conda/mamba." ] }, { "cell_type": "markdown", - "id": "2682a9ea", + "id": "e8556ab8", "metadata": {}, "source": [ - "If you wish to run exercise locally, you can certainly install Python and Jupyter interactive notebook on your own laptop, see the installation instructions below." + "| Feature | **Python with pip** | **Conda/Mamba** |\n", + "|---------|----------------|-----------------|\n", + "| **Installation** | Install Python from python.org, pip included | Install Anaconda/Miniconda distribution |\n", + "| **Package Management** | `pip install package` | `conda install package` or `mamba install package` |\n", + "| **Environment Management** | `venv` or `virtualenv` (separate tools) | Built-in: `conda create -n myenv` |\n", + "| **Package Repository** | PyPI (Python Package Index) | Anaconda repository + conda-forge |\n", + "| **Non-Python Dependencies** | Limited (Python packages only) | Excellent (handles Python, R, C libraries, etc.) |\n", + "| **Complexity** | Simpler, more lightweight | More comprehensive, heavier |\n", + "| **Best For** | Pure Python development, simple projects | Data science, scientific computing, complex dependencies |\n", + "| **Speed** | Fast package installation | Slower (conda), faster with mamba |\n", + "| **Architecture Support** | Excellent (source packages work on any architecture, if compiling tools available) | Limited to pre-built binaries for common architectures |\n", + "| **Reproducibility** | `requirements.txt` | `environment.yml` with exact versions |\n", + "| **Modern Tooling** | **uv** (ultra-fast installer), **Poetry** (dependency & packaging) | **Mamba** (faster conda drop-in replacement), **Pixi** (modern project/workflow tool) |" ] }, { @@ -3541,7 +3553,7 @@ "id": "9bf355f1", "metadata": {}, "source": [ - "### Installing Python" + "### Installing Python and pip" ] }, { @@ -3639,16 +3651,11 @@ "id": "88323ba7", "metadata": {}, "source": [ - "1. Once Python is installed (whether from python.org, your Linux package manager, or Anaconda), you can install Jupyter Notebook as follows:\n", - "```\n", - "pip install jupyter\n", - "```\n", - "\n", - "Or Jupyter Lab, the next-generation web-based interface for the Jupyter project (which I'll be using)\n", + "1. Once Python is installed (whether from python.org, your Linux package manager, or Anaconda), you can install Jupyter Lab as follows:\n", "```\n", "pip install jupyterlab\n", "```\n", - "(Use `pip3` if needed, e.g., › `pip3 install jupyter`) • If you chose Anaconda, Jupyter Notebook is already included, so you can skip this step.\n", + "(Use `pip3` if needed, e.g., › `pip3 install jupyter`)\n", "\n", "2. When everything is installed, you can start a Jupyter notebook server (or Jupyter Lab) and work on your Python exercises by simply running in your terminal or command prompt:\n", "```\n", @@ -3661,6 +3668,159 @@ "\n", "This will open a new tab in your web browser with the Jupyter Notebook or Jupyter Lab interface, ready for you to start coding!" ] + }, + { + "cell_type": "markdown", + "id": "1ea7de96", + "metadata": {}, + "source": [ + "### Installing Mamba (via Miniforge)" + ] + }, + { + "cell_type": "markdown", + "id": "88f8fa02", + "metadata": {}, + "source": [ + "#### On Windows:" + ] + }, + { + "cell_type": "markdown", + "id": "bc5d5add", + "metadata": {}, + "source": [ + "1. Go to https://github.com/conda-forge/miniforge and download the Miniforge3 installer for Windows (e.g., \"Miniforge3-Windows-x86_64.exe\").\n", + "2. Run the installer and follow the prompts. You can accept the default options.\n", + "3. After installation, open \"Miniforge Prompt\" from the Start menu and verify:\n", + "\n", + "```bash\n", + "mamba --version\n", + "conda --version\n", + "```\n", + "\n", + "This should confirm that Mamba and Conda are installed successfully.\n", + "\n", + " - Miniforge comes with `mamba` pre-installed and uses conda-forge as the default channel." + ] + }, + { + "cell_type": "markdown", + "id": "a9daafa9", + "metadata": {}, + "source": [ + "#### On Linux (Ubuntu/Debian-based and others):" + ] + }, + { + "cell_type": "markdown", + "id": "ba271553", + "metadata": {}, + "source": [ + "1. Open a terminal and download the installer:\n", + "```bash\n", + "wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh\n", + "```\n", + "\n", + "2. Run the installer:\n", + "```bash\n", + "bash Miniforge3-Linux-x86_64.sh\n", + "```\n", + "\n", + "3. Follow the prompts, accept the license, and allow the installer to initialize Miniforge.\n", + "\n", + "4. Restart your terminal or run:\n", + "```bash\n", + "source ~/.bashrc\n", + "```\n", + "\n", + "5. Confirm your installation:\n", + "```bash\n", + "mamba --version\n", + "conda --version\n", + "```\n", + "\n", + " - For ARM-based systems, download `Miniforge3-Linux-aarch64.sh` instead." + ] + }, + { + "cell_type": "markdown", + "id": "f2e714e4", + "metadata": {}, + "source": [ + "#### On macOS:" + ] + }, + { + "cell_type": "markdown", + "id": "232aee40", + "metadata": {}, + "source": [ + "1. Download the installer from https://github.com/conda-forge/miniforge:\n", + " - For Intel Macs: `Miniforge3-MacOSX-x86_64.sh`\n", + " - For Apple Silicon (M1/M2/M3): `Miniforge3-MacOSX-arm64.sh`\n", + "\n", + "2. Open Terminal and navigate to your Downloads folder, then run:\n", + "```bash\n", + "bash Miniforge3-MacOSX-*.sh\n", + "```\n", + "(Replace `*` with `x86_64` or `arm64` depending on your system)\n", + "\n", + "3. Follow the installation prompts and allow the installer to initialize Miniforge.\n", + "\n", + "4. Restart your terminal or run:\n", + "```bash\n", + "source ~/.bash_profile # or ~/.zshrc if using zsh\n", + "```\n", + "\n", + "5. Verify the installation:\n", + "```bash\n", + "mamba --version\n", + "conda --version\n", + "```\n", + "\n", + " - Alternatively, if you have Homebrew installed, you can run:\n", + "```bash\n", + "brew install --cask miniforge\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "68d32a65", + "metadata": {}, + "source": [ + "#### Installing and Running Jupyter Notebooks with Mamba" + ] + }, + { + "cell_type": "markdown", + "id": "38068a3a", + "metadata": {}, + "source": [ + "1. Once Miniforge/Mamba is installed, you can install JupyterLab in a new environment for your project:\n", + "```bash\n", + "mamba create -n myproject python=3.11 jupyterlab\n", + "mamba activate myproject\n", + "```\n", + "\n", + "2. Start Jupyter:\n", + "```bash\n", + "jupyter notebook\n", + "```\n", + "or\n", + "```bash\n", + "jupyter lab\n", + "```\n", + "\n", + "This will open a new tab in your web browser with the Jupyter interface, ready for you to start coding!" + ] + }, + { + "cell_type": "markdown", + "id": "ac3d4b98", + "metadata": {}, + "source": [] } ], "metadata": { From cff5571396a6c444a2517d781f84a17b49ecc0d8 Mon Sep 17 00:00:00 2001 From: Dmitry Nikolaenko Date: Thu, 6 Nov 2025 15:10:47 +0000 Subject: [PATCH 4/4] Delete unnecessary MD file --- installing_python.md | 78 -------------------------------------------- 1 file changed, 78 deletions(-) delete mode 100644 installing_python.md diff --git a/installing_python.md b/installing_python.md deleted file mode 100644 index 4fe9b51..0000000 --- a/installing_python.md +++ /dev/null @@ -1,78 +0,0 @@ -# Bonus chapter - -## How to run python on your own computer - -If you wish to run exercise locally, you can certainly install Python and Jupyter interactive notebook on your own laptop, see the installation instructions below. - -### Installing Python - -#### On Windows: - -1. Go to https://www.python.org/downloads/) and choose the latest stable installer for Windows (for example, “Windows installer (64-bit)”). -2. During installation, make sure to check the box “Add Python to PATH” so you can use Python from any command prompt. -3. After installation finishes, open a new Terminal (Command Prompt or PowerShell) and type: - -``` -python --version -``` - -This should confirm that Python installed successfully. - - - Alternatively, you could install the Anaconda distribution from https://www.anaconda.com/products/distribution, which includes Python and a variety of data-science packages by default. - -#### On Linux (Ubuntu/Debian-based): - -1. Open a terminal. -2. Run: -``` -sudo apt-get update -sudo apt-get install python3 python3-pip -``` -(Adjust to python or python3 depending on your distribution) - -1. Confirm your installation by running: -``` -python3 --version -``` - - - For Fedora or other distributions, replace `apt-get` with `yum`, `dnf`, or your distro’s package manager. - - You can also install Anaconda if you want a more complete environment. - - -#### On macOS: - -1. Visit https://www.python.org/downloads/ and download the macOS installer (e.g., “macOS 64-bit universal2 installer”). -2. Double-click the `.pkg` file and follow the prompts. -3. After installation, open Terminal and check: -``` -python3 --version -``` - - - Alternatively, on macOS you can install Python via Homebrew (if you already have Homebrew installed) by running: -``` -brew install python3 -``` - -#### Installing and Running Jupyter Notebooks - -1. Once Python is installed (whether from python.org, your Linux package manager, or Anaconda), you can install Jupyter Notebook as follows: -``` -pip install jupyter -``` - -Or Jupyter Lab, the next-generation web-based interface for the Jupyter project (which I'll be using) -``` -pip install jupyterlab -``` -(Use `pip3` if needed, e.g., › `pip3 install jupyter`) • If you chose Anaconda, Jupyter Notebook is already included, so you can skip this step. - -2. When everything is installed, you can start a Jupyter notebook server (or Jupyter Lab) and work on your Python exercises by simply running in your terminal or command prompt: -``` -jupyter notebook -``` -or -``` -jupyter lab -``` - -This will open a new tab in your web browser with the Jupyter Notebook or Jupyter Lab interface, ready for you to start coding! \ No newline at end of file