|
12 | 12 | "* Bad example filename: *amazon_sagemaker-processing-images_with_pytorch_on_GPU.ipynb* (too long & mixes case, dashes, and underscores)\n",
|
13 | 13 | "* Good example filename: *processing_images_pytorch_gpu.ipynb* (succinct, all lowercase, all underscores)\n",
|
14 | 14 | "\n",
|
| 15 | + "**IMPORTANT:** Use only one maining heading with `#`, so your next subheading is `##` or `###` and so on.\n", |
15 | 16 | "\n",
|
16 | 17 | "## Overview\n",
|
17 | 18 | "1. What does this notebook do?\n",
|
|
47 | 48 | "1. Describe any pip or conda or apt installs or setup scripts that are needed.\n",
|
48 | 49 | "1. Pin sagemaker if version <2 is required.\n",
|
49 | 50 | "\n",
|
50 |
| - " `!{sys.executable} -m pip install \"sagemaker>=1.14.2,<2\"`\n", |
| 51 | + " `%pip install \"sagemaker>=1.14.2,<2\"`\n", |
51 | 52 | " \n",
|
52 | 53 | " \n",
|
53 | 54 | "1. Upgrade sagemaker if version 2 is required, but rollback upgrades to packages that might taint the user's kernel and make other notebooks break. Do this at the end of the notebook in the cleanup cell.\n",
|
|
56 | 57 | " # setup\n",
|
57 | 58 | " import sagemaker\n",
|
58 | 59 | " version = sagemaker.__version__\n",
|
59 |
| - " !{sys.executable} -m pip install 'sagemaker>=2.0.0'\n", |
| 60 | + " %pip install 'sagemaker>=2.0.0'\n", |
60 | 61 | " ...\n",
|
61 | 62 | " # cleanup\n",
|
62 |
| - " !{sys.executable} -m pip install 'sagemaker=={}'.format(version)\n", |
| 63 | + " %pip install 'sagemaker=={}'.format(version)\n", |
63 | 64 | " ```\n",
|
64 | 65 | " \n",
|
65 | 66 | "\n",
|
|
74 | 75 | "source": [
|
75 | 76 | "# SageMaker Python SDK version 1.x is required\n",
|
76 | 77 | "import sys\n",
|
77 |
| - "!{sys.executable} -m pip install -U \"sagemaker>=1.14.2,<2\"" |
| 78 | + "%pip install \"sagemaker>=1.14.2,<2\"" |
78 | 79 | ]
|
79 | 80 | },
|
80 | 81 | {
|
|
87 | 88 | "import sagemaker\n",
|
88 | 89 | "import sys\n",
|
89 | 90 | "original_version = sagemaker.__version__\n",
|
90 |
| - "!{sys.executable} -m pip install 'sagemaker>=2.0.0'" |
| 91 | + "%pip install 'sagemaker>=2.0.0'" |
91 | 92 | ]
|
92 | 93 | },
|
93 | 94 | {
|
|
225 | 226 | "print(\"Current version: {}\".format(sagemaker.__version__))\n",
|
226 | 227 | "s = 'sagemaker=={}'.format(version)\n",
|
227 | 228 | "print(\"Rolling back to... {}\".format(s))\n",
|
228 |
| - "!{sys.executable} -m pip install {s}\n", |
| 229 | + "%pip install {s}\n", |
229 | 230 | "import sagemaker\n",
|
230 | 231 | "print(\"{} installed!\".format(sagemaker.__version__))"
|
231 | 232 | ]
|
|
0 commit comments