Set up the Gemini API Quickstart Python environment
mainFollow these steps to prepare your local development environment for the Gemini API Quickstart application:
- Install Python: Ensure Python is installed from Python.org.
- Clone the repository: Clone this repository to your local machine.
- Create and activate a virtual environment:
- macOS/Linux:
python -m venv venv source venv/bin/activate - Windows:
python -m venv venv .\venv\Scripts\activate
- macOS/Linux:
- Install dependencies: Run
pip install -r requirements.txtto install the necessary Python packages. - Configure Environment Variables:
- Copy the example environment file:
cp .env.example .env. - Open the
.envfile and add your Gemini API key.
- Copy the example environment file:
- Run the Flask application: Execute
flask runto start the server.
The app will be accessible at http://localhost:5000.
$ python -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ cp .env.example .env
$ flask run