Linux Installation
This guide covers how to set up Google Gemini on Linux distributions for DevOps automation and cloud infrastructure management.
Prerequisites
Python 3.9 or higher
pip (Python package manager)
A Google Cloud account with Gemini API access
Google Cloud CLI (optional, but recommended)
Installation Steps
1. Set Up Python Environment
It's recommended to use a virtual environment:
2. Install Google Gemini SDK
Install the official Python SDK:
For AI Studio integration:
3. Configure Authentication
There are two main methods for authentication:
Option A: API Key (Simplest)
Store the key securely in your environment:
To make this permanent, add to your .bashrc
or .zshrc
:
Option B: Service Account (For Production)
Create a service account in Google Cloud Console
Grant appropriate permissions (Vertex AI User or similar)
Download the service account key JSON file
Set the environment variable:
4. Verify Installation
Create a simple test script test_gemini.py
:
Run the script:
Installing Additional Components
NotebookML
For NotebookML integration:
Gemini for CLI
For a command-line interface to Gemini:
Troubleshooting
Common Issues
API Key Not Found: Ensure your environment variable is correctly set
Library Conflicts: If you encounter dependency conflicts:
Quota Exceeded: Check your quota usage in Google Cloud Console
SSL Certificate Issues: Update certificates:
System Integration
For DevOps workflows, you can install the Gemini CLI:
This tool allows you to use Gemini directly in shell scripts and automation workflows.
Last updated