Installing Gemini CLI via pip (Python) step-by-step, safely and correctly, right inside VS Code.
🧩 Step 1: Verify Python and pip
Open your VS Code terminal (Ctrl + ` ) and check:
python --version
pip --version
You should see output like:
Python 3.10.8
pip 24.0 from ...
If either command isn’t recognized, install Python first from
👉 https://www.python.org/downloads/
and check “Add Python to PATH” during installation.
⚙️ Step 2: (Optional but Recommended) Create a Virtual Environment
This keeps your dependencies isolated and clean.
python -m venv gemini-env
Activate it:
-
Windows (PowerShell):
gemini-env\Scripts\activate -
macOS/Linux:
source gemini-env/bin/activate
You’ll see (gemini-env) appear before your terminal prompt — that means it’s active.
🧰 Step 3: Install Gemini CLI via pip
Now, in your activated terminal, run:
pip install gemini-cli
or (if you want to install for your user only):
pip install --user gemini-cli
⚠️ Note: The Gemini CLI is not yet an official Google-distributed PyPI package in some regions.
Ifpipsays “No matching distribution found for gemini-cli”, you can still install it manually (see below 👇).
🧪 Step 4: Verify Installation
After installation completes, check:
gemini --version
If successful, you’ll see:
gemini-cli 1.x.x
If not recognized, you may need to add the Python Scripts folder to your PATH:
Windows:
C:\Users\<YourName>\AppData\Roaming\Python\Python3x\Scripts
macOS/Linux:
~/.local/bin
Then restart VS Code.
⚙️ Step 5: (Optional) Manual pip Install from GitHub Source
If pip install gemini-cli doesn’t work because the package isn’t on PyPI in your region, try installing directly from GitHub:
pip install git+https://github.com/google/gemini-cli.git
This grabs the latest version directly from the official source.
✅ Step 6: Use Gemini CLI in VS Code
Now you can run Gemini CLI commands directly in VS Code’s terminal:
| Command | Description |
|---|---|
gemini --help |
Shows all available commands |
gemini init |
Creates a new Gemini project |
gemini auth login |
Log in to your Google AI account |
gemini run |
Runs your Gemini app locally |
gemini deploy |
Deploys your Gemini project |
Example:
gemini init my-first-gemini
cd my-first-gemini
gemini auth login
gemini run
✅ You’re done!
You’ve installed the Gemini CLI via pip and can now use it right in VS Code.
PYTHON
🧩 What is Python?
Python is a programming language — it’s the actual runtime that executes .py code files.
When you install Python, you get:
-
The Python interpreter (the program that runs Python code)
-
The standard library (built-in modules like
os,math,json, etc.) -
The pip tool (the package installer)
You use python (or python3) to run scripts or start an interactive shell.
💻 Examples:
python hello.py
or
python
>>> print("Hello, world!")
Hello, world!
📦 What is pip?
pip stands for “Pip Installs Packages.”
It’s Python’s package manager — a tool used to download, install, and manage third-party Python libraries that are not included with Python itself.
These packages come from the Python Package Index (PyPI) — a huge online repository of community-created Python packages.
💻 Examples:
pip install requests
pip install numpy
pip install gemini-cli
After installing, you can use those packages in your Python code:
import requests
⚙️ How Python and pip Work Together
Think of it like this:
| Tool | Purpose |
|---|---|
| 🐍 Python | Runs code and executes programs |
| 📦 pip | Installs and manages extra packages that Python can use |
They’re two sides of the same coin — pip installs the tools, and Python runs them.
🧠 Analogy
| Real-world Example | Python Equivalent |
|---|---|
| A phone | Python (the thing that does the work) |
| The app store | pip (where you get extra apps) |
| An app you install | A Python package like requests, flask, or gemini-cli |
⚠️ Common Confusions
-
“I installed pip but python isn’t found.”
-
You need Python first; pip comes with it.
-
-
“I installed a package but can’t use it.”
-
It might have been installed for a different Python version.
Check with:python -m pip install package-nameThat ensures pip installs for that exact Python interpreter.
-
-
Multiple Python versions
-
Sometimes you’ll see
python3andpip3.
Those just point to Python 3.x and its pip tool.
🔍 Example in Context (Gemini CLI)
-
python→ the language runtime (runs scripts or tools) -
pip→ installsgemini-cliso you can then rungeminicommands
Example:
pip install gemini-cli
gemini --version
Behind the scenes, gemini is a Python-based command-line app that pip placed in your Python Scripts directory.
✅ In short:
Python = the engine that runs your programs
pip = the installer that gives Python more tools to use
Comments