Skip to content

Commit b0497b6

Browse files
committed
Updated Module 01
1 parent a1ca6b0 commit b0497b6

3 files changed

Lines changed: 47 additions & 10 deletions

File tree

modules/m01-getting-started/m01t01-setting-up-python.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ Before installing Anaconda, update the *Debian* build-tools by executing:
3030
sudo apt-get install --upgrade build-essential
3131
```
3232

33-
Download the command line installer (`.sh`) for the latest version of Anaconda Python from the [individual product download page](https://www.anaconda.com/products/individual). Alternatively, you can download the installer from the terminal using `curl` (cURL) using the following commands:
33+
Download the command line installer (`.sh`) for the latest version of Anaconda Python from the [individual product download page](https://www.anaconda.com/products/individual). Alternatively, you can download the installer from the terminal using `curl` (cURL) using the following commands (select the lastest build from [the archive](https://repo.anaconda.com/archive), in this case `2024.10-1`):
3434

3535
```bash
3636
sudo apt-get install --upgrade curl
37-
curl -O https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh
37+
curl -O https://repo.anaconda.com/archive/Anaconda3-2024.02-1-Linux-x86_64.sh
3838
```
3939

40-
Install the downloaded file by running the following command in the terminal, replacing `path/to/downloaded/file` with the complete path to the directory of the file along with the file name:
40+
Install the downloaded file by running the following command in the terminal, replacing `path-to-downloaded-file` with the complete path to the directory of the file along with the file name:
4141

4242
```bash
43-
bash path/to/downloaded/file.sh
43+
bash path-to-downloaded-file.sh
4444
```
4545

4646
***Note: Linux usually comes with official Python distributions accessible through `python3` for version 3.x and `python` for version 2.x.***
@@ -83,22 +83,23 @@ Python 3.x.x
8383
It is useful to create individual virtual environments to run different versions of Python depending on the requirements of specific packages.
8484
And the `conda` package provides an easy way to manage such virtual environments.
8585

86-
To create a new environment (say, by the name `py38`) supporting a particular version of Python (say Python 3.8.x), use the following command:
86+
The default environment typically goes by the name `base`.
87+
To create a new environment (say, by the name `py312`) supporting a particular version of Python (say Python 3.8.x), use the following command:
8788

8889
```
89-
conda create --name py38 python=3.8
90+
conda create --name py312 python=3.12
9091
```
9192

9293
Once the creation is complete, you can activate the environment by:
9394

9495
```
95-
conda activate py38
96+
conda activate py312
9697
```
9798

9899
To remove the created environment, use the following command:
99100

100101
```
101-
conda env remove --name py38
102+
conda env remove --name py312
102103
```
103104

104105
## Managing Anaconda Packages

modules/m01-getting-started/m01t02-the-python-interpreter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Access the Python interpreter in the *interactive mode* by running `python` in t
1111
A welcome message containing the version, current date and time, and a line of default commands will be displayed, followd by a *primary prompt* (`>>>`) in the final line as below:
1212

1313
```bash
14-
Python 3.8.12 (default, Oct 12 2021, 03:01:40) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
14+
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:03:56) [MSC v.1929 64 bit (AMD64)] on win32
1515
Type "help", "copyright", "credits" or "license" for more information.
1616
>>>
1717
```
Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,46 @@
1-
# M01T04 - The Jupyter Notebook
1+
# M01T04 - The Jupyter Notebook and JupyterLab
22

33
![Conda](https://img.shields.io/conda/vn/conda-forge/jupyter?label=version&style=for-the-badge)
44
![Conda](https://img.shields.io/conda/dn/conda-forge/jupyter?style=for-the-badge)
55

66
> A journey to the largest pynet (*planet*)!
77
8+
[`Project Jupyter`](https://jupyter.org/) provides a great way to work with different languages, be it to perform quick calculations or run extensive models.
9+
The classic `Jupyter Notebook` is a lighweight web-based application to create presentable views or document computational workflows.
10+
It's modern interface is known as the `JupyterLab`, which is a modular, feature-rich web-based interactive development environment suitable for a variety of workflows.
11+
Both of them provide a handful of tools to work with Python-based scripts.
12+
13+
## Installing the Jupyter Notebook and JupyterLab
14+
15+
Jupyter Notebook and JupyterLab already come bundled inside the base environment when `Anaconda` is installed.
16+
One can also install them in any environment (say, the `py312` environment) with the following command:
17+
18+
```bash
19+
conda install -n py312 notebook jupyterlab
20+
```
21+
22+
## Multi-environment Execution
23+
24+
It is [advisable](https://towardsdatascience.com/how-to-set-up-anaconda-and-jupyter-notebook-the-right-way-de3b7623ea4a) to install the notebook applications in the `base` environment and access the kernels of other environments through it without explicitly installing it in the other environments.
25+
To do this, one needs to install [nb_conda_kernels](https://github.com/Anaconda-Platform/nb_conda_kernels) in the `base` environment (or the specific environment using which the notebook servers will be run) using:
26+
27+
```bash
28+
conda install -n base nb_conda_kernels
29+
```
30+
31+
Then, in any other environment (say, the `py312` environment), one can just install the IPython kernel by exectuing:
32+
33+
```bash
34+
conda activate py312
35+
conda install ipykernel
36+
```
37+
38+
Additionally, the interactive IPython widgets (more about it later) can be installed in this environment using:
39+
40+
```bash
41+
conda install ipywidgets
42+
```
43+
844
[← \[Previous\] M01T03 - The Spyder IDE](./m01t03-the-spyder-ide.md)
945

1046
[\[Next\] M01T05 - Python in VSCode →](./m01t05-python-in-vscode.md)

0 commit comments

Comments
 (0)