Skip to content

Commit 1321223

Browse files
committed
typos and minor improvements
1 parent 1e9fd0b commit 1321223

1 file changed

Lines changed: 18 additions & 14 deletions

File tree

notebooks/installing_Python.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
We will use a free environment management system called **conda** to install Python and the necessary scientific libraries for the course. The conda management system allows to install, run, and update Python packages while ensuring compatibility between different package versions on your machine. It also allows to efficiently manage Python environments, which are essentially independent Python installations. More details on this later.
44

5-
## Install Python, Python scientific libraries, and Jupyter Lab using Miniconda
5+
[TOC]
6+
7+
## 1. Install Python, scientific libraries, and Jupyter Lab using Miniconda
68

79
For this course, we will use Miniconda which allows us to manage Python packages through a console with a minimal installation (don't be scared, it's simpler than it sounds).
810

@@ -66,7 +68,7 @@ We will learn how to use Jupyter Lab properly during the course.
6668
> This is a cross-platform desktop application for Jupyter Lab. It is exactly the same application that opens in the browser, but in an encapsulated application. You can find the user guide at the following link https://github.com/jupyterlab/jupyterlab-desktop/blob/master/user-guide.md
6769
6870

69-
## Managing Python packages (install, remove, update, clean)
71+
## 2. Managing Python packages: install, remove, update, and clean.
7072

7173
The following are the basic commands for installing, removing and and keep your Python libraries up to date.
7274

@@ -94,20 +96,20 @@ conda clean --all
9496

9597

9698

97-
## More on conda/Python environments
99+
## 3. Conda/Python environments: why and how
98100

99101
Environments enables you to have multiple versions of Python or scientific packages installed on your computer at the same time. This is useful, for example, to test a script on different versions of Python and any other Python library, or to keep separate different scientific libraries that may work with different Python versions, etc.
100102

101-
```
102-
list all existing environments
103-
>conda env list
103+
```markdown
104+
# list all existing environments
105+
conda env list
104106
```
105107

106-
### Create and remove an environment
108+
### 3.1 Create and remove an environment
107109

108110
to create a new environment using conda the general procedure is as follows (in the anaconda prompt)
109111

110-
``>conda create --name <name of my env> <list of packages>``
112+
``conda create --name <ENV NAME> <list of packages to install>``
111113

112114
> you can use ``-n`` instead of ``--name`` if preferred
113115
@@ -132,7 +134,7 @@ conda env remove --name <ENV NAME>
132134

133135
More info here: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
134136

135-
### Adding Python packaged from other channels or via pip in conda
137+
### 3.2 Adding Python packages from other channels
136138

137139
At some point, you are likely to find yourself in the situation where you want to install a Python package that is not in the official (default) conda channel, and you need to install it using pip, the standard Python installation package, or the community-driven _conda-forge_ channel. In this case, it is strongly recommended to create a new Python environment and, in particular, never use pip to install packages into the Python environments you have for general use, as this may break compatibility between different versions of the environment.
138140

@@ -165,9 +167,9 @@ conda config --append channels conda-forge
165167
> ```
166168
167169
168-
### Using environment.ylm (YALM) files
170+
### 3.3 Using environment.ylm (YALM) files
169171
170-
An ``environment.ylm`` file is used to specify the dependencies for a Python project in conjunction with the ``conda`` package manager. It is a plain text file that looks like this:
172+
An ``environment.ylm`` file is a YALM file used to specify the dependencies for a Python project in conjunction with the ``conda`` package manager. It is a plain text file that looks like this:
171173
172174
![image-20221215134600921](https://github.com/marcoalopez/Python_course/blob/main/img/image-20221215134600921.png?raw=true)
173175
@@ -179,15 +181,17 @@ To create a conda environment using an ``environment.ylm`` file from the command
179181
180182
This will create a new conda environment called with the name defined within the ``environment.ylm`` file.
181183
182-
To create an ``environment.ylm`` file from a specific conda environment do as follows
184+
On the other hand, if you want to create an ``environment.ylm`` file from your own conda environment, so that anyone can replicate it on their machine, do the following:
183185
184186
```markdown
187+
# activate the specific environment
185188
conda activate <environment name>
186189
190+
# create the YALM file
187191
conda env export > environment.yml
188192
```
189193
190-
This command will export the list of packages and their versions that are installed in the current active conda environment so that you can quickly share it with anyone.
194+
This command exports the list of packages and their versions installed in the currently active conda environment, so that you can quickly share it with anyone.
191195
192196
> [!TIP]
193-
> Sharing conda environments with other researchers facilitates reproducibility in research. So we encourage you to create and share environment.yml files in which you have conducted the data analysis every time you make a scientific publication.
197+
> Sharing conda environments with other researchers facilitates reproducibility of research. We therefore encourage you to create and share the environment.yml files in which you have performed the data analysis each time you publish a scientific paper.

0 commit comments

Comments
 (0)