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: getting-started.md
+15-16
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ Here a few areas where you might apply Python in your work.
51
51
52
52
## Use JupyterLab to edit and run Python code.
53
53
54
-
If you haven't already done so, see [the setup instructions](../learners/setup.md) for details on how to install JupyterLab and Python via Anaconda. The setup instructions also walk you through the steps you should follow to create an `lc-python` folder on your Desktop, and to download and unzip the dataset we'll be working with inside of that directory.
54
+
If you haven't already done so, see [the setup instructions](../learners/setup.md) for details on how to install JupyterLab and Python using Miniforge. The setup instructions also walk you through the steps you should follow to create an `lc-python` folder on your Desktop, and to download and unzip the dataset we'll be working with inside of that directory.
55
55
56
56
### Getting started with JupyterLab
57
57
To run Python, we are going to use Jupyter Notebooks via [JupyterLab][jupyterlab]. Jupyter notebooks are common tools for data science and visualization, and serve as a convenient environment for running Python code interactively where we can view and share the results of our Python code.
@@ -71,40 +71,40 @@ Jupyter notebooks let us execute and view the results of our Python code immedia
71
71
- Each notebook contains one or more cells that contain code, text, or images.
72
72
73
73
### Start JupyterLab
74
-
Once you have created the `lc-python` directory on your Desktop, you can start JupyterLab by opening a shell command line interface or by using Anaconda Navigator.
74
+
Once you have created the `lc-python` directory on your Desktop, you can start JupyterLab by opening a shell command line interface.
75
75
76
76
#### Mac users - Command Line
77
77
78
78
1. Press the <kbd>cmd</kbd> + <kbd>spacebar</kbd> keys and search for `Terminal`. Click the result or press <kbd>return</kbd>. (You can also find `Terminal` in your `Applications` folder, under `Utilities`.)
79
-
2. After you have launched Terminal, change directories to the `lc-python` folder you created earlier and type `jupyter lab`. Note that the `$` sign is used to indicate a command to be typed on the command prompt, but we never type the `$` sign itself, just what follows after it.
79
+
2. After you have launched Terminal, change directories to the `lc-python` folder you created earlier.
80
+
3. Next run `conda activate carpentries` to launch a Python environment which includes Jupyter Notebooks and other tools we will need to proceed through the lesson.
81
+
4. Finally, type `jupyter lab` which should open a browser window where you can run Jupyter Notebooks.
82
+
83
+
Note that the `$` sign is used to indicate a command to be typed on the command prompt, but we never type the `$` sign itself, just what follows after it.
80
84
81
85
```bash
82
86
$ cd ../Desktop/lc-python
87
+
$ conda activate carpentries
83
88
$ jupyter lab
84
89
```
85
90
86
91
#### Windows users - Command Line
87
92
88
93
To start the JupyterLab server you will need to access the Anaconda Prompt.
89
94
90
-
1. Press the <kbd>Windows Logo Key</kbd> and search for `Anaconda Prompt`, click the result or press enter.
95
+
1. Press the <kbd>Windows Logo Key</kbd> and search for `Miniforge Prompt`, click the result or press enter.
96
+
2. Once you have launched the Miniforge Prompt, change directories to the `lc-python` folder you created earlier. (The example below assumes a starting path of `C:\Users\username`)
97
+
3. Next run `conda activate carpentries` to launch a Python environment which includes Jupyter Notebooks and other tools we will need to proceed through the lesson.
98
+
4. Finally, type `jupyter lab` which should open a browser window where you can run Jupyter Notebooks.
91
99
92
-
2. Once you have launched the Anaconda Prompt, type the command `jupyter lab`. Note that the `$` sign is used to indicate a command to be typed on the command prompt, but we never type the `$` sign itself, just what follows after it.
100
+
Note that the `$` sign is used to indicate a command to be typed on the command prompt, but we never type the `$` sign itself, just what follows after it.
93
101
94
102
```bash
95
-
$ cd ..\Desktop\lc-python
103
+
$ cd\Desktop\lc-python
104
+
$ conda activate carpentries
96
105
$ jupyter lab
97
106
```
98
107
99
-
#### Start JupyterLab from Anaconda Navigator
100
-
If you are unfamiliar with the command line, you can launch JupyterLab by opening the Anaconda Navigator app and choosing the `Launch` button underneath the JuypterLab icon.
101
-
102
-
First [start Anaconda Navigator (click for detailed instructions on macOS, Windows, and Linux)](https://docs.anaconda.com/free/navigator/getting-started/#navigator-starting-navigator). You can search for Anaconda Navigator via Spotlight on macOS (<kbd>Command</kbd> + <kbd>spacebar</kbd>), or by using the Windows search function (<kbd>Windows Logo Key</kbd>).
103
-
104
-
After you have launched Anaconda Navigator, click the `Launch` button under JupyterLab. You may need to scroll down to find it. Here is a screenshot of an Anaconda Navigator page similar to the one that should open on either macOS or Windows.
105
-
106
-
{alt='screenshot of the launch button for JuypterLab in Anaconda Navigator'}
107
-
108
108
## The JupyterLab Interface
109
109
110
110
Launching JupyterLab opens a new tab or window in your preferred web browser. While JupyterLab enables you to run code from your browser, it does not require you to be online. If you take a look at the URL in your browser address bar, you should see that the environment is located at your localhost, meaning it is running from your computer: `http://localhost:8888/lab`.
@@ -191,7 +191,6 @@ You can also use "hotkeys"" to change Jupyter cells from Code to Markdown and ba
191
191
- Press the <kbd>y</kbd> key to convert the cell back to Code.
Copy file name to clipboardExpand all lines: libraries.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -120,7 +120,7 @@ The ASCII letters are abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
120
120
121
121
## Module not found error
122
122
123
-
Before you can import a Python library, you sometimes will need to download and install it on your machine. Anaconda comes with many of the most popular Python libraries for scientific computing applications built-in, so if you installed Anaconda for this workshop, you'll be able to import many common libraries directly. Some less common tools, like the PyMarc library, however, would need to be installed first.
123
+
Before you can import a Python library, you sometimes will need to download and install it on your machine. The Carpentries conda environment that we're using for the workshop installs a number of common Python libraries for academic computing. Since those are available when you activate the environment you'll be able to import many common libraries directly. Some less common tools, like the PyMarc library, however, would need to be installed first.
124
124
125
125
```python
126
126
import pymarc
@@ -130,7 +130,7 @@ import pymarc
130
130
ModuleNotFoundError: No module named 'pymarc'
131
131
```
132
132
133
-
You can find out how to install the library by looking at the documentation. [PyMarc](https://pypi.org/project/pymarc/), for example, recommends using a command line tool, `pip`, to install it. You can install with pip in a Jupyter notebook by starting the command with a percentage symbol, which allows you to run shell commands from Jupyter:
133
+
You can find out how to install the library by looking at the documentation. [PyMarc](https://pypi.org/project/pymarc/), for example, recommends using a command line tool, `pip`, for installation, though you can also [install PyMarc using conda](https://anaconda.org/asmeurer/pymarc). To install with pip in a Jupyter notebook you can begin the command with a percentage symbol, which allows you to run shell commands from Jupyter:
Copy file name to clipboardExpand all lines: setup.md
+9-37
Original file line number
Diff line number
Diff line change
@@ -2,46 +2,19 @@
2
2
title: Setup
3
3
---
4
4
5
-
## Installing Python Using Anaconda
6
-
Python is a popular language for research computing, and great for general-purpose programming as well. Installing all of its research packages individually can be a bit difficult, so we recommend Anaconda, an all-in-one installer.
5
+
## Installing Python Using Miniforge
7
6
8
-
Regardless of how you choose to install it, please make sure you install Python 3.6 or above. The latest 3.x version recommended on [Python.org][python] is fine.
7
+
[Python](https://python.org) is a popular language for scientific computing, and great for general-purpose programming as well.
8
+
For this workshop we use Python version 3.x.
9
+
Installing all of its scientific packages individually can be a bit difficult, so we provide an environment file to help you take care of them all together.
10
+
We will use the _Miniforge_ distribution of Python.
9
11
10
-
We will teach Python using JupyterLab, a programming environment that runs in a web browser (JupyterLab will be installed by Anaconda). For this to work you will need a reasonably up-to-date browser. The current versions of the Chrome, Safari and Firefox browsers are all supported (some older browsers, including Internet Explorer version 9 and below, are not).
11
-
12
-
::::::::::::::::: tab
13
-
14
-
### Windows
15
-
16
-
[Watch a video tutorial for Windows][video-windows].
17
-
18
-
1. Open [anaconda.com/download][anaconda-dl] with your web browser.
19
-
2. Download the Anaconda for Windows installer with Python 3. (If you are not sure which version to choose, you probably want the 64-bit Graphical Installer *Anaconda3-...-Windows-x86_64.exe*)
20
-
3. Install Python 3 by running the Anaconda Installer, using all of the defaults for installation except make sure to check *Add Anaconda to my PATH environment variable*.
21
-
22
-
### Mac
23
-
24
-
[Watch a video tutorial for Mac][video-mac].
25
-
26
-
1. Open [anaconda.com/download][anaconda-dl] with your web browser.
27
-
2. Download the Anaconda Installer with Python 3 for macOS (you can either use the Graphical or the Command Line Installer).
28
-
3. Install Python 3 by running the Anaconda Installer using all of the defaults for installation.
29
-
30
-
### Linux
31
-
32
-
Note that the following installation steps require you to work from the shell. If you aren't comfortable doing the installation yourself stop here and request help from the workshop organizers.
33
-
34
-
1. Open [anaconda.com/download][anaconda-dl] with your web browser.
35
-
2. Download the Anaconda Installer with Python 3 for Linux.
36
-
3. Open a terminal window and navigate to the directory where the executable is downloaded (e.g., `cd ~/Downloads`).
37
-
4. Type `bash Anaconda3` and press <kbd>Tab</kbd> to auto-complete the full file name. The name of file you just downloaded should appear.
38
-
5. Press <kbd>Enter</kbd> (or <kbd>Return</kbd> depending on your keyboard). You will follow the text-only prompts. To move through the text, press <kbd>Spacebar</kbd>. Type `yes` and press <kbd>Enter</kbd> to approve the license. Press <kbd>Enter</kbd> (or <kbd>Return</kbd>) to approve the default location for the files. Type `yes` and press <kbd>Enter</kbd> (or <kbd>Return</kbd>) to prepend Anaconda to your PATH (this makes the Anaconda distribution the default Python).
39
-
6. Close the terminal window.
40
-
41
-
:::::::::::::::::::::::::
12
+
Please refer to the [Python section of the workshop website for installation instructions](https://carpentries.github.io/workshop-template/install_instructions/#python).
42
13
43
14
## JupyterLab
44
-
We will teach Python using JupyterLab, a part of a family of [Jupyter][jupyter] tools that includes Jupyter Notebook and JupyterLab, both of which provide interactive web environments where you can write and run Python code. If you installed Anaconda, JupyterLab is installed on your system. If you did not install Anaconda, you can [install JupyterLab][jupyter-install] on its own using conda, pip, or other popular package managers.
15
+
We will teach Python using JupyterLab, a part of a family of [Jupyter][jupyter] tools that includes Jupyter Notebook and JupyterLab, both of which provide interactive web environments where you can write and run Python code.
16
+
If you followed the instructions linked above, JupyterLab is installed on your system.
17
+
Alternatively, you can [install JupyterLab][jupyter-install] on its own using conda, pip, or other popular package managers.
45
18
46
19
## Download the data
47
20
@@ -53,7 +26,6 @@ This lesson uses circulation data in multiple CSV files from the Chicago Public
0 commit comments