{ "cells": [ { "cell_type": "markdown", "id": "493932a3-7245-4583-b738-0b6c6455c8bf", "metadata": {}, "source": [ "# Preparations and installation" ] }, { "cell_type": "markdown", "id": "ac433eef-1f58-4b35-bdb4-9a76a0af94a3", "metadata": {}, "source": [ "To follow the tutorials, it is strongly suggested to use a virtual environment management, such as [Python venv](https://docs.python.org/3/library/venv.html), or more powerfull package managers like [uv](https://docs.astral.sh/uv/).\n", "\n", "We suggest using uv, as it is very fast and more flexible. If you don't have it installed, you can find the instructions [here](https://docs.astral.sh/uv/getting-started/installation/). \n", "\n", "For running the tutorials, you can move to some path on your machine that is suitable for this:\n", "\n", "```bash\n", "cd /path/to/tutorials\n", "```" ] }, { "cell_type": "markdown", "id": "0197da7f-c0cb-4516-963d-fc17c16cb27e", "metadata": {}, "source": [ "## Using uv" ] }, { "attachments": {}, "cell_type": "markdown", "id": "e8a3a306-a6b3-487d-8342-056cb131a08c", "metadata": {}, "source": [ "Create a virtual environment and activate it by typing\n", "```bash\n", "uv venv\n", "source .venv/bin/activate\n", "```\n", "\n", "**Note** Technically, with uv, you don't need to manually activate the venv as long as you are in the same folder. For consistency, and making sure you work in the right venv, we activate it for this tutorial.\n", "\n", "Next, you need to install MADAS:\n", "```bash\n", "uv pip install madas\n", "```" ] }, { "cell_type": "markdown", "id": "2e6708f9-bda9-4a36-988d-5e15d0b31d91", "metadata": {}, "source": [ "### Following along in the command line" ] }, { "cell_type": "markdown", "id": "a59f35ed-b8f4-43da-826c-fe113b1149cf", "metadata": {}, "source": [ "If you want to follow the tutorials in the command line, after activating your virtual environment, you can run a Python interpreter:\n", "\n", "```bash\n", "uv run python\n", "```\n", "and copy the commands from the MADAS website." ] }, { "cell_type": "markdown", "id": "0688f0ef-3d17-42fa-8901-aed834065366", "metadata": {}, "source": [ "### Running the notebooks locally" ] }, { "cell_type": "markdown", "id": "b8e1988a-ba57-4887-970c-d4349e8db386", "metadata": {}, "source": [ "For running the notebooks locally, you first need to install `jupyter`:\n", "```bash\n", "uv pip install jupyter\n", "```\n", "\n", "Then, download the tutorials from https://madas.readthedocs.io/en/latest/tutorials.html\n", "and save them at the same path where your virtual environment is.\n", "\n", "Run\n", "```bash\n", "uv run jupyter notebook\n", "```\n", "to open jupyter and click on the tutorial that you want to do." ] }, { "cell_type": "markdown", "id": "61930d91-75e3-42ab-a59c-1a953cd8a718", "metadata": {}, "source": [ "## Using Python venv" ] }, { "cell_type": "markdown", "id": "afa8f0db-eb1f-488a-a2b4-8cfd38fb089c", "metadata": {}, "source": [ "Create a virtual environment and activate it by typing\n", "```bash\n", "python3 -m venv .venv\n", "source .venv/bin/activate\n", "```\n", "Next, you need to install MADAS:\n", "```bash\n", "pip install madas\n", "```" ] }, { "cell_type": "markdown", "id": "71a262e1-0ab7-4392-b8d3-05b4536d69eb", "metadata": {}, "source": [ "### Following along in the command line" ] }, { "attachments": {}, "cell_type": "markdown", "id": "193ccfd0-2165-4b71-9796-2cda81afedab", "metadata": {}, "source": [ "If you want to follow the tutorials in the command line, after activating your virtual environment, you can run a Python interpreter:\n", "\n", "```bash\n", "python\n", "```\n", "and copy the commands from the MADAS website." ] }, { "cell_type": "markdown", "id": "c3e2fff8-8948-4323-97df-29c3baf03728", "metadata": {}, "source": [ "### Running the notebooks locally" ] }, { "cell_type": "markdown", "id": "f1600430-6f8b-42bc-a41b-d89fa1610052", "metadata": {}, "source": [ "For running the notebooks locally, you first need to install `jupyter`:\n", "```bash\n", "pip install jupyter\n", "```\n", "\n", "Then, download the tutorials from https://madas.readthedocs.io/en/latest/tutorials.html\n", "and save them at the same path where your virtual environment is.\n", "\n", "Run\n", "```bash\n", "jupyter notebook\n", "```\n", "to open jupyter and click on the tutorial that you want to do." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.8" } }, "nbformat": 4, "nbformat_minor": 5 }