From e9e9f5e9465a76993326641e4f92e55fe96a7176 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Wed, 5 Jun 2024 14:42:15 +0200 Subject: [PATCH 1/3] First commit copied environments from mude website --- book/_toc.yml | 1 + book/environments.md | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 book/environments.md diff --git a/book/_toc.yml b/book/_toc.yml index b21c2ce..0da213a 100644 --- a/book/_toc.yml +++ b/book/_toc.yml @@ -9,5 +9,6 @@ parts: sections: - file: some_content/text_and_code.ipynb # END REMOVE-FROM-PUBLISH + - file: environments.md - file: references.md - file: credits.md diff --git a/book/environments.md b/book/environments.md new file mode 100644 index 0000000..4cb53cf --- /dev/null +++ b/book/environments.md @@ -0,0 +1,23 @@ +# Environments + +Now we will make sure you have an environment to get started in MUDE. This year we will use Python 3.11, so we are going to make sure that’s installed and ready to go. Other Python packages that are not included in the base installation will be installed in your environment one at a time as we go through our Programming Assignments, to make sure we know exactly what is going on when working with code in MUDE. + +The following steps will create an Anaconda environment called mude and install Python 3.11. Even if you already have Python 3.11, it is still good practice to create a dedicated Anaconda environment for each of your major projects (and MUDE is definitely a major project). Please make sure you have upgraded Anaconda before proceeding with these steps: + +Open the commmand line interface (see above)—you can also continue in the same session if it is still active +- Execute: `conda create -n mude python=3.11 anaconda` (this may take several minutes) +- Activate: conda activate mude +- Check: you should now see mude displayed somewhere in the prompt between parenthesis, like this: (mude) +One important reminder: throughout the semester you should be using the mude environment every time you use Python, except when instructed otherwise. All you have to do is remember to use the command conda activate mude prior to opening your notebook. The suggested workflow is described in the instructions for Week 1, and you can also find them on the course website here. + +Make it a habit of installing packages with the command line interface +We need to make sure the right packages are installed and available, which you should also do from the terminal. The procedure is described on the Packages page (you can also access these instructions directly from the Software page). + +Note that we have two “things” called “mude”: an Anaconda environment and a Python package. You will always use an environment when working with a notebook in MUDE (“mude” the first few weeks, but eventually we will create more—the name is arbitrary). The package “mude” is one of many Python packages we will use in the module; you won’t need to use it every time you work on a notebook. You can install the mude package now, or you can wait until you need it for your first programming assignment, it does not matter. + +Now that we have our Python environment set up, you’re almost ready to start your first Programming Assignment, but we still have one thing to do: create a suitable place in the file system of your computer to work. + +```python +import numpy as np +np.linspace(0,10,11) +``` \ No newline at end of file From 57d5153661556d3982cec0f81a7fd3eb5dc5f790 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Wed, 5 Jun 2024 16:14:45 +0200 Subject: [PATCH 2/3] Update environments.md --- book/environments.md | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/book/environments.md b/book/environments.md index 4cb53cf..a05c54f 100644 --- a/book/environments.md +++ b/book/environments.md @@ -1,23 +1,22 @@ # Environments -Now we will make sure you have an environment to get started in MUDE. This year we will use Python 3.11, so we are going to make sure that’s installed and ready to go. Other Python packages that are not included in the base installation will be installed in your environment one at a time as we go through our Programming Assignments, to make sure we know exactly what is going on when working with code in MUDE. - -The following steps will create an Anaconda environment called mude and install Python 3.11. Even if you already have Python 3.11, it is still good practice to create a dedicated Anaconda environment for each of your major projects (and MUDE is definitely a major project). Please make sure you have upgraded Anaconda before proceeding with these steps: +Once installed, we will check to make sure you are ready to use Python. Anaconda provides environments, like small virtual mini-computers inside your real computer, and inside each of those environments you have Python (and a lot of Python packages, probably). Let’s try it: -Open the commmand line interface (see above)—you can also continue in the same session if it is still active -- Execute: `conda create -n mude python=3.11 anaconda` (this may take several minutes) -- Activate: conda activate mude -- Check: you should now see mude displayed somewhere in the prompt between parenthesis, like this: (mude) -One important reminder: throughout the semester you should be using the mude environment every time you use Python, except when instructed otherwise. All you have to do is remember to use the command conda activate mude prior to opening your notebook. The suggested workflow is described in the instructions for Week 1, and you can also find them on the course website here. +1. Open a command line interface on your computer: + - Windows users: this will be the anaconda or conda prompt (search for it in the Start menu at the bottom left of your screen) + - Mac users: use the “terminal” application +2. Once the command line interface is open, type then execute (hit return) the following: `python --version` +3. You should be running at least Python 3.11. If not, don’t worry, we will try to fix it below (but first make sure you have updated Anaconda as described above) +4. Which environment are you in? The name is between parenthesis at the bottom of your Anaconda Prompt: by default, this should be `(base)`. +5. How many other environments do you have? Execute `conda env list` to see a complete list. +6. Do you see the `*` in the list of environments? That is indicating your current active environment. Unless you have changed something, it should be `base`. And if you just installed Anaconda or Miniconda for the first time, this will be your only environment! -Make it a habit of installing packages with the command line interface -We need to make sure the right packages are installed and available, which you should also do from the terminal. The procedure is described on the Packages page (you can also access these instructions directly from the Software page). - -Note that we have two “things” called “mude”: an Anaconda environment and a Python package. You will always use an environment when working with a notebook in MUDE (“mude” the first few weeks, but eventually we will create more—the name is arbitrary). The package “mude” is one of many Python packages we will use in the module; you won’t need to use it every time you work on a notebook. You can install the mude package now, or you can wait until you need it for your first programming assignment, it does not matter. +Now we will make sure you have an environment to get started in MUDE. This year we will use Python 3.11, so we are going to make sure that’s installed and ready to go. Other Python packages that are not included in the base installation will be installed in your environment one at a time as we go through our Programming Assignments, to make sure we know exactly what is going on when working with code in MUDE. -Now that we have our Python environment set up, you’re almost ready to start your first Programming Assignment, but we still have one thing to do: create a suitable place in the file system of your computer to work. +The following steps will create an Anaconda environment called `mude` and install Python 3.11. Even if you already have Python 3.11, it is still good practice to create a dedicated Anaconda environment for each of your major projects (and MUDE is definitely a major project). -```python -import numpy as np -np.linspace(0,10,11) -``` \ No newline at end of file +1. Open the commmand line interface (see above)—you can also continue in the same session if it is still active +2. Execute: `conda create -n mude python=3.11 anaconda` (this may take several minutes) +3. Activate: `conda activate mude` +4. Check: you should now see `mude` displayed somewhere in the prompt between parenthesis, like this: `(mude)` +One important reminder: throughout the semester you should be using the `mude` environment every time you use Python, except when instructed otherwise. All you have to do is remember to use the command `conda activate mude` prior to opening your notebook. The suggested workflow is described in the instructions for Week 1, and you can also find them on the course website here. \ No newline at end of file From 8575207745616982531f9ec7d4b2c58ea8a0000e Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Wed, 5 Jun 2024 16:22:05 +0200 Subject: [PATCH 3/3] Update environments.md --- book/environments.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/book/environments.md b/book/environments.md index a05c54f..2f34538 100644 --- a/book/environments.md +++ b/book/environments.md @@ -1,22 +1,22 @@ # Environments -Once installed, we will check to make sure you are ready to use Python. Anaconda provides environments, like small virtual mini-computers inside your real computer, and inside each of those environments you have Python (and a lot of Python packages, probably). Let’s try it: +Once installed Anaconda, we will check to make sure you are ready to use Python. Anaconda provides environments, like small virtual mini-computers inside your real computer, and inside each of those environments you might have Python (and a lot of Python packages, probably). Let’s try it: 1. Open a command line interface on your computer: - - Windows users: this will be the anaconda or conda prompt (search for it in the Start menu at the bottom left of your screen) - - Mac users: use the “terminal” application + - Windows users: this will be the anaconda or conda prompt (search for it in the Start menu at the bottom left of your screen) + - Mac users: use the “terminal” application 2. Once the command line interface is open, type then execute (hit return) the following: `python --version` -3. You should be running at least Python 3.11. If not, don’t worry, we will try to fix it below (but first make sure you have updated Anaconda as described above) +3. You should be have a somewhat [recent version of Python](https://www.python.org/doc/versions/). If not, don’t worry, we will try to fix it later on 4. Which environment are you in? The name is between parenthesis at the bottom of your Anaconda Prompt: by default, this should be `(base)`. 5. How many other environments do you have? Execute `conda env list` to see a complete list. 6. Do you see the `*` in the list of environments? That is indicating your current active environment. Unless you have changed something, it should be `base`. And if you just installed Anaconda or Miniconda for the first time, this will be your only environment! -Now we will make sure you have an environment to get started in MUDE. This year we will use Python 3.11, so we are going to make sure that’s installed and ready to go. Other Python packages that are not included in the base installation will be installed in your environment one at a time as we go through our Programming Assignments, to make sure we know exactly what is going on when working with code in MUDE. +Now we will make sure you have an environment to get started. We'll just make sure `pip` is included in this environment so we can use that to install more stuff later on. -The following steps will create an Anaconda environment called `mude` and install Python 3.11. Even if you already have Python 3.11, it is still good practice to create a dedicated Anaconda environment for each of your major projects (and MUDE is definitely a major project). +The following steps will create an Anaconda environment: 1. Open the commmand line interface (see above)—you can also continue in the same session if it is still active -2. Execute: `conda create -n mude python=3.11 anaconda` (this may take several minutes) -3. Activate: `conda activate mude` -4. Check: you should now see `mude` displayed somewhere in the prompt between parenthesis, like this: `(mude)` -One important reminder: throughout the semester you should be using the `mude` environment every time you use Python, except when instructed otherwise. All you have to do is remember to use the command `conda activate mude` prior to opening your notebook. The suggested workflow is described in the instructions for Week 1, and you can also find them on the course website here. \ No newline at end of file +2. Execute: `conda create -n myenv pip` (this may take several minutes) +3. Activate: `conda activate myenv` +4. Check: you should now see `myenv` displayed somewhere in the prompt between parenthesis, like this: `(myenv)` +One important reminder: throughout your project, you should be using the `myenv` environment every time. All you have to do is remember to use the command `conda activate myenv` prior to opening your preferred code editor, or select the `myenv` environment from without your code editor. \ No newline at end of file