From 3d24a0ed91c4d8911c5b4745e0aa4321f7a20367 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Fri, 6 Dec 2024 07:30:19 +0100 Subject: [PATCH] small changes --- book/installation-and-setup/anaconda.md | 14 +++++++------- book/workflows/user45_check_changes.md | 8 +------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/book/installation-and-setup/anaconda.md b/book/installation-and-setup/anaconda.md index 2018504..502ffe9 100644 --- a/book/installation-and-setup/anaconda.md +++ b/book/installation-and-setup/anaconda.md @@ -36,18 +36,18 @@ A python virtual environment is, like the name might suggest, a reserved space w Now we will set up your first environment. The following steps will create an Anaconda environment 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 such as creating a jupyter book. -For simplicity we will call this environment `my_new_book`, but you can give it any name you like. +For simplicity we will call this environment `my_new_book_env`, but you can give it any name you like. 1. Open the commmand line interface (see above) or continue in the same session if it is still active -2. Execute: `conda create --name my_new_book pip` (this may take several minutes) -3. Activate: `conda activate my_new_book` -
Check: you should now see your new environment displayed somewhere in the prompt between parenthesis, like this: `(my_new_book)` +2. Execute: `conda create --name my_new_book_env pip` (this may take several minutes) +3. Activate: `conda activate my_new_book_env` +
Check: you should now see your new environment displayed somewhere in the prompt between parenthesis, like this: `(my_new_book_env)` 4. Additional 4th step: `pip install -r requirements.txt` (explanation in the following section) Now everytime you want to work on your jupyter-book, you need to activate the environment! (step 3) If you don't activate your environment, you will work in a 'wrong' working environment that might not contain all the packages you need. -As mentioned before, python packages can be downloaded in the environments you create. Both NumPy and pandas are popular Python packages used for data manipulation and analysis. For the creation of Jupyter Books, we will use the package `jupyter-book`. More information about this package [here](jupyter-book-setup.md). +As mentioned before, python packages can be downloaded in the environments you create. Both NumPy and pandas are popular Python packages used for data manipulation and analysis. For the creation of Jupyter Books, we will use the package `teachbooks` which is a wrapper around JupyterBooks. More information about this package [here](jupyter-book-setup.md). ### Import environments @@ -121,7 +121,7 @@ If you want to create an environment based on an existing `*.yml` file, you can This may take several minutes because you are installing many packages at once! Keep an eye on the terminal window as this process is completed. First `conda` is collecting information about the dependencies, then it will _solve_ the environment; in other words, figure out which version of each package it should use. Once it is ready, it will present the list of packages and proceed with the "installation" (really just downloading `*.py` files and putting them in a folder on your computer) Note that the prompt may ask you to confirm that the installation should proceed, depending on your system settings. -Once the environment is created, we can activate it, and also check that everything was installed properly. Try `conda env export -n my_new_book` to see what was installed by "default." The list is very long, even though we only asked for a few packages! +Once the environment is created, we can activate it, and also check that everything was installed properly. Try `conda env export -n my_new_book_env` to see what was installed by "default." The list is very long, even though we only asked for a few packages! It is also interesting to try `conda env export --from-history` (make sure you activated it already), which shows the specific packages requested. @@ -135,7 +135,7 @@ If you have many projects, the amount of environments can take up a lot of space To remove an environment, in your Anaconda Prompt, run: -`conda remove --name my_new_book --all` +`conda remove --name my_new_book_env --all` You will be asked to confirm the deletion, then it may take a while to remove all of the files. To verify that the environment was removed, in your terminal window or an Anaconda Prompt, run: diff --git a/book/workflows/user45_check_changes.md b/book/workflows/user45_check_changes.md index 45f7e03..4b2377c 100644 --- a/book/workflows/user45_check_changes.md +++ b/book/workflows/user45_check_changes.md @@ -9,7 +9,7 @@ Navigate to the terminal in VS code, located at the bottom of the window or by c You will firstly need to activate the right environment. Type the following command: ``` -conda activate jupyter-book-env +conda activate my_new_book_env ``` (or the environment in which you have installed the `teachbooks` package!) @@ -20,12 +20,6 @@ Then we can build the book locally. Make sure you are in the right repository in teachbooks build ``` -Alternatively: - -``` -jupyter-book build --all -``` - Note: use `--all` for the jupyter-book whenever building a book to make sure the table of contents fully updates. Or alternatively, delete the old `_build` folder before building the new book. Where book is the name of the folder containing all the files that make up your book. After `teachbooks` is done running you will get the following: