Registry / gcp / google-cloud-notebooks

google-cloud-notebooks

JSON →
library1.16.0pypypi✓ verified 89d ago

The `google-cloud-notebooks` client library provides Python access to the Google Cloud AI Platform Notebooks API. This managed service offers an integrated and secure JupyterLab environment for data scientists and machine learning developers to experiment, develop, and deploy models into production. The library is currently at version 1.16.0 and is part of the broader `google-cloud-python` ecosystem, which maintains a frequent release cadence, often with monthly updates for various client libraries.

pip install google-cloud-notebooks
INSTALL
IMPORT
SIG · GOOGLE-CLOUD-NOTEB
G
google-cloud-notebooks
gcppythonv1.16.0
Install
5.4s avg
Import
1944ms
Disk
71MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.16.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 2.322s · 72.2MB
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 5.4s · import 1.565s · 70MB
71MB installed
● package 71MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NotebookServiceClient
✓ from google.cloud.notebooks_v1.services.notebook_service import NotebookServiceClient
types
✓ from google.cloud.notebooks_v1 import types

This quickstart initializes the `NotebookServiceClient` and lists existing Notebook instances in a specified Google Cloud project and location. Ensure your `GCP_PROJECT_ID` and `GCP_LOCATION` environment variables are set, or replace the placeholder values. Authentication typically relies on Application Default Credentials, which can be set up using `gcloud auth application-default login` for local development.

import os from google.cloud.notebooks_v1.services.notebook_service import NotebookServiceClient from google.cloud.notebooks_v1 import types # Set your Google Cloud Project ID and desired location (e.g., 'us-central1') project_id = os.environ.get('GCP_PROJECT_ID', 'your-gcp-project-id') location = os.environ.get('GCP_LOCATION', 'us-central1') def list_notebook_instances(project_id: str, location: str): """Lists all Notebook instances in a given project and location.""" client = NotebookServiceClient() parent = f"projects/{project_id}/locations/{location}" print(f"Listing Notebook instances in {parent}:") try: request = types.ListInstancesRequest(parent=parent) page_result = client.list_instances(request=request) for response in page_result: print(f" Instance: {response.name} (State: {response.state.name})") if not page_result: print(" No instances found.") except Exception as e: print(f"Error listing instances: {e}") print("Ensure the Notebooks API is enabled for your project and location.") print("Also, verify that your default credentials are set up (e.g., `gcloud auth application-default login`).") if __name__ == "__main__": list_notebook_instances(project_id, location)
Debug
Known issues
breakingThe `google-cloud-notebooks` client library requires Python 3.9 or newer. Older Python versions (3.8 and below) are not supported and will lead to compatibility issues or installation failures.
fix
Upgrade your Python environment to 3.9 or a newer supported version (e.g., `python3.9 -m pip install google-cloud-notebooks`).
affects: <1.16.0 (for Python <3.9)
gotchaLogs generated by this library might contain sensitive information. If you enable logging and save these logs, ensure proper access restrictions are in place. The content and level of log messages can also change in future releases without being flagged as breaking changes.
fix
Review log contents before saving or exposing them. Avoid relying on the immutability of log message formats for automated parsing.
affects: All versions
gotchaFor authentication in development environments, especially within Jupyter notebooks or Colab, avoid hardcoding or directly embedding service account keys. Prefer using Application Default Credentials (`gcloud auth application-default login`) or Colab's built-in `auth.authenticate_user()` to leverage temporary credentials and reduce security risks.
fix
Use `gcloud auth application-default login` on your local machine or VM, or `from google.colab import auth; auth.authenticate_user()` in Colab, to configure credentials. Do not commit service account key files to version control.
affects: All versions
Errors
Common errors & fixes
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.INTERNAL details = "An internal error has occurred (…)">
This error typically indicates a transient issue on the Google Cloud server side, such as a hardware failure, software bug, or network problem. It's often not directly related to client-side code logic.
fix
Implement retry logic with exponential backoff for API calls. Consider increasing the request `timeout` parameter if the issue persists, as shown in some examples.
ImportError: No module named 'google.cloud.notebooks_v1'
The `google-cloud-notebooks` library or its specific `notebooks_v1` sub-module is not installed in the active Python environment, or the environment is not correctly configured.
fix
Ensure the library is installed (`pip install google-cloud-notebooks`) and that you are running your code in the same Python environment where it was installed. If using virtual environments, activate it before running your script.
DefaultCredentialsError: Could not automatically determine credentials.
The application cannot find valid credentials to authenticate with Google Cloud. This commonly happens when running locally without setting up Application Default Credentials or when the Notebooks API is not enabled for the project.
fix
Run `gcloud auth application-default login` in your terminal to set up credentials for local development. Ensure the 'Notebooks API' is enabled in your Google Cloud project for the target region via the Google Cloud Console.
Upgrade
Version history
1.16.0latest on PyPI · released Mar 26, 2026
Audit
Dependencies
PythonrequiredRequired for the client library.
Agent activity
22 hits · last 30 days
node
20
OpenAI (training)
1
Resources
google-cloud-notebooks — pip install google-cloud-notebooks · libregistry