Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Menginstal dependensi
Setelah membuat instance notebook yang dikelola pengguna, Anda mungkin perlu untuk
menginstal software yang
menjadi dependensi notebook Anda. Anda dapat menginstal dependensi dengan menambahkan perintah
penginstalan ke file di dalam notebook, atau dengan menggunakan jendela
terminal.
Keuntungan menambahkan perintah penginstalan ke file adalah, saat Anda membagikan
notebook, perintah untuk menginstal dependensi akan disimpan di
dalam notebook, dan tersedia bagi para pengguna yang Anda ajak untuk berbagi notebook.
Menginstal dependensi dari instance notebook yang dikelola pengguna
Untuk menginstal paket Python dari instance notebook
yang dikelola pengguna:
Di konsol Google Cloud , buka halaman Notebook yang dikelola pengguna.
Pilih instance tempat Anda ingin menginstal dependensi.
Klik Open JupyterLab.
Untuk membuka jendela terminal, Anda dapat menggunakan menu atau Launcher.
Menu
Untuk membuka jendela terminal dari menu, pilih
File > New > Terminal.
Jendela terminal akan terbuka.
Launcher
Untuk membuka jendela terminal dari Launcher, pilih
File > New > Launcher.
Di dalam Other, klik tile Terminal.
Jendela terminal akan terbuka.
Di dalam jendela terminal, masukkan perintah untuk menginstal dependensi
software untuk instance notebook yang dikelola pengguna.
Untuk menginstal library deep learning mxnet
di dalam notebook Python 3, masukkan perintah berikut
ini:
pip3 install mxnet
Setelah penginstalan selesai, mulai ulang kernel untuk memastikan
bahwa library-nya telah tersedia untuk diimpor. Di dalam setiap file notebook yang terbuka dalam
instance notebook yang dikelola pengguna yang sama, pilih
Kernel > Restart kernel.
Pilih File > Save notebook untuk menyimpan notebook tersebut.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-19 UTC."],[],[],null,["# Install dependencies on a Vertex AI Workbench user-managed notebooks instance\n\nInstall dependencies\n====================\n\n\n| Vertex AI Workbench user-managed notebooks is\n| [deprecated](/vertex-ai/docs/deprecations). On\n| April 14, 2025, support for\n| user-managed notebooks will end and the ability to create user-managed notebooks instances\n| will be removed. Existing instances will continue to function\n| but patches, updates, and upgrades won't be available. To continue using\n| Vertex AI Workbench, we recommend that you\n| [migrate\n| your user-managed notebooks instances to Vertex AI Workbench instances](/vertex-ai/docs/workbench/user-managed/migrate-to-instances).\n\n\u003cbr /\u003e\n\nAfter you create a user-managed notebooks instance, you might need to\ninstall software that\nyour notebook depends on. You can install dependencies by adding install\ncommands to a file in your notebook or by using a terminal\nwindow.\n\nAn advantage of adding install commands to a file is that, when you share\na notebook, the commands to install the dependencies are saved with the\nnotebook and are available to users that you share the notebook with.\n\nInstall dependencies from a user-managed notebooks instance\n-----------------------------------------------------------\n\nTo install Python packages from a user-managed notebooks\ninstance:\n\n1. In the Google Cloud console, go to the **User-managed notebooks** page.\n\n [Go to User-managed notebooks](https://console.cloud.google.com/vertex-ai/workbench/user-managed)\n2. Select the instance where you want to install dependencies.\n\n3. Click **Open JupyterLab**.\n\n4. To add a notebook file, you can use the menu or the Launcher.\n\n ### Menu\n\n 1. To add a new notebook file from the menu, select\n **File \\\u003e New \\\u003e Notebook**.\n\n 2. In the **Select kernel** dialog, select the kernel for your new\n notebook, for example, **Python 3** , and then click **Select**.\n\n Your new notebook file opens.\n\n ### Launcher\n\n 1. To add a new Python 3 notebook file from the Launcher, select\n **File \\\u003e New \\\u003e Launcher**.\n\n 2. Click the **Python 3** tile.\n\n Your new notebook file opens.\n5. Rename your new notebook file.\n\n ### Menu\n\n 1. Select **File \\\u003e Rename notebook** . The\n **Rename file** dialog opens.\n\n 2. In the **New name** field, change `Untitled.ipynb` to something\n meaningful, such as `install.ipynb`.\n\n 3. Click **Rename**.\n\n ### Launcher\n\n 1. Right-click the `Untitled.ipynb` tab and then click\n **Rename notebook** . The **Rename file** dialog opens.\n\n 2. In the **New name** field, change `Untitled.ipynb` to something\n meaningful, such as `install.ipynb`.\n\n 3. Click **Rename**.\n\n6. Install dependencies as follows.\n\n When you open your new notebook, there is a default code cell where you\n can enter code, in this case Python 3.\n\n To install the [mxnet](https://mxnet.apache.org/)\n deep learning library in a Python 3 notebook, enter the following\n command in the code cell:\n\n `%pip install mxnet`\n\n7. Click the run button to run the install command.\n\n8. When installation is complete, select\n **Kernel \\\u003e Restart kernel**\n to restart the kernel and ensure the library is available for import.\n\n9. Select **File \\\u003e Save notebook** to save the notebook.\n\nInstall dependencies from a terminal\n------------------------------------\n\nTo connect to a terminal, you can use your JupyterLab notebook or\n[SSH](/vertex-ai/docs/workbench/user-managed/ssh-access). To install Python\npackages from a terminal:\n\n1. In the Google Cloud console, go to the **User-managed notebooks** page.\n\n [Go to User-managed notebooks](https://console.cloud.google.com/vertex-ai/workbench/user-managed)\n2. Select the instance where you want to install dependencies.\n\n3. Click **Open JupyterLab**.\n\n4. To open a terminal window, you can use the menu or the Launcher.\n\n ### Menu\n\n To open a terminal window from the menu, select\n **File \\\u003e New \\\u003e Terminal**.\n\n The terminal window opens.\n\n ### Launcher\n\n 1. To open a terminal window from the Launcher, select\n **File \\\u003e New \\\u003e Launcher**.\n\n 2. In **Other** , click the **Terminal** tile.\n\n The terminal window opens.\n5. In the terminal window, enter the command to install the software\n dependency for your user-managed notebooks instance.\n\n To install the [mxnet](https://mxnet.apache.org/)\n deep learning library for Python 3 notebooks, enter the following\n command:\n\n `pip3 install mxnet`\n\n6. When installation is complete, restart the kernel to make sure the\n library is available for import. In every open notebook file in the\n same user-managed notebooks instance, select\n **Kernel \\\u003e Restart kernel**.\n\n7. Select **File \\\u003e Save notebook** to save the notebook."]]