You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/m01-getting-started/m01t01-setting-up-python.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,17 +30,17 @@ Before installing Anaconda, update the *Debian* build-tools by executing:
30
30
sudo apt-get install --upgrade build-essential
31
31
```
32
32
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`):
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:
41
41
42
42
```bash
43
-
bash path/to/downloaded/file.sh
43
+
bash path-to-downloaded-file.sh
44
44
```
45
45
46
46
***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
83
83
It is useful to create individual virtual environments to run different versions of Python depending on the requirements of specific packages.
84
84
And the `conda` package provides an easy way to manage such virtual environments.
85
85
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:
87
88
88
89
```
89
-
conda create --name py38 python=3.8
90
+
conda create --name py312 python=3.12
90
91
```
91
92
92
93
Once the creation is complete, you can activate the environment by:
93
94
94
95
```
95
-
conda activate py38
96
+
conda activate py312
96
97
```
97
98
98
99
To remove the created environment, use the following command:
Copy file name to clipboardExpand all lines: modules/m01-getting-started/m01t02-the-python-interpreter.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Access the Python interpreter in the *interactive mode* by running `python` in t
11
11
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:
12
12
13
13
```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
15
15
Type "help", "copyright", "credits" or "license"for more information.
[`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
+
8
44
[←\[Previous\] M01T03 - The Spyder IDE](./m01t03-the-spyder-ide.md)
9
45
10
46
[\[Next\] M01T05 - Python in VSCode →](./m01t05-python-in-vscode.md)
0 commit comments