|
32 | 32 | },
|
33 | 33 | {
|
34 | 34 | "cell_type": "markdown",
|
35 |
| - "metadata": {}, |
| 35 | + "metadata": { |
| 36 | + "tags": [] |
| 37 | + }, |
36 | 38 | "source": [
|
37 |
| - "## Note for Google Colab users\n", |
| 39 | + "## Google Colab users: Follow these instructions before your start!\n", |
| 40 | + "\n", |
| 41 | + "**Google Colab** doesn't have PyGMT and its dependencies installed. You need to follow the instructions below to install them.\n", |
38 | 42 | "\n",
|
39 |
| - "Google Colab doesn't have PyGMT and its dependencies installed. You need to run the following commands to install them once.\n", |
| 43 | + "First, we need to install conda on Google Colab. The installation process is greatly simplified using the [condacolab](https://github.com/conda-incubator/condacolab) package.\n", |
40 | 44 | "\n",
|
41 |
| - "Be patient! The installation may take a few minutes." |
| 45 | + "*After condacolab finishes the installation, it will restart the Python kernel for changes to be applied. This happens automatically. Thus, you will see a message saying \"Your session crashed for an unknown reason\". You can safely ignore this message!*" |
42 | 46 | ]
|
43 | 47 | },
|
44 | 48 | {
|
|
47 | 51 | "metadata": {},
|
48 | 52 | "outputs": [],
|
49 | 53 | "source": [
|
50 |
| - "!wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh\n", |
51 |
| - "!chmod +x Miniconda3-latest-Linux-x86_64.sh\n", |
52 |
| - "!bash ./Miniconda3-latest-Linux-x86_64.sh -bfp /usr/local\n", |
53 |
| - "!conda update conda -y -q\n", |
54 |
| - "!conda config --prepend channels conda-forge\n", |
55 |
| - "!conda install -q -y --prefix /usr/local python=3.7 pygmt\n", |
56 |
| - "\n", |
57 |
| - "import sys\n", |
58 |
| - "import os\n", |
59 |
| - "sys.path.append('/usr/local/lib/python3.7/site-packages')\n", |
60 |
| - "os.environ[\"GMT_LIBRARY_PATH\"]=\"/usr/local/lib\"" |
| 54 | + "!pip install -q condacolab\n", |
| 55 | + "import condacolab\n", |
| 56 | + "condacolab.install()" |
| 57 | + ] |
| 58 | + }, |
| 59 | + { |
| 60 | + "cell_type": "markdown", |
| 61 | + "metadata": {}, |
| 62 | + "source": [ |
| 63 | + "Now we can install PyGMT and its dependencies using a single command. The installation may take a few minutes:" |
| 64 | + ] |
| 65 | + }, |
| 66 | + { |
| 67 | + "cell_type": "code", |
| 68 | + "execution_count": null, |
| 69 | + "metadata": {}, |
| 70 | + "outputs": [], |
| 71 | + "source": [ |
| 72 | + "!mamba install pygmt" |
61 | 73 | ]
|
62 | 74 | },
|
63 | 75 | {
|
|
231 | 243 | ],
|
232 | 244 | "metadata": {
|
233 | 245 | "kernelspec": {
|
234 |
| - "display_name": "Python 3", |
| 246 | + "display_name": "Python 3 (ipykernel)", |
235 | 247 | "language": "python",
|
236 | 248 | "name": "python3"
|
237 | 249 | },
|
|
245 | 257 | "name": "python",
|
246 | 258 | "nbconvert_exporter": "python",
|
247 | 259 | "pygments_lexer": "ipython3",
|
248 |
| - "version": "3.8.5" |
| 260 | + "version": "3.9.15" |
249 | 261 | }
|
250 | 262 | },
|
251 | 263 | "nbformat": 4,
|
|
0 commit comments