Skip to main content

Installation Guide

Get AI Math Notes up and running on your machine in just a few steps. This guide covers everything from installing Python dependencies to configuring your OpenAI API credentials.

Prerequisites

Before you begin, ensure you have:
  • Python 3.7 or higher installed on your system
  • An OpenAI API key (you can get one at platform.openai.com)
  • pip package manager (included with Python)
AI Math Notes uses the OpenAI GPT-4o model, which requires API credits. Make sure your OpenAI account has available credits before proceeding.

Installation Steps

1

Clone the Repository

Download the AI Math Notes source code from GitHub:
git clone https://github.com/ayushpai/AI-Math-Notes.git
cd AI-Math-Notes
Alternatively, download the ZIP file from the repository and extract it to your desired location.
2

Install Dependencies

Install the required Python libraries using pip:
pip install -r requirements.txt
This will install:
  • pillow==10.2.0 - For image processing and canvas rendering
  • openai==1.14.2 - For connecting to OpenAI’s GPT-4o API
Consider using a virtual environment to keep dependencies isolated:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
3

Set Up OpenAI API Key

Configure your OpenAI API key as an environment variable. The application uses the OpenAI Python client, which automatically reads from the OPENAI_API_KEY environment variable.On macOS/Linux:
export OPENAI_API_KEY='your-api-key-here'
To make it permanent, add this line to your ~/.bashrc, ~/.zshrc, or ~/.bash_profile:
echo "export OPENAI_API_KEY='your-api-key-here'" >> ~/.zshrc
source ~/.zshrc
On Windows (Command Prompt):
setx OPENAI_API_KEY "your-api-key-here"
On Windows (PowerShell):
$env:OPENAI_API_KEY="your-api-key-here"
Never commit your API key to version control. Keep it secure and don’t share it publicly.
4

Verify Installation

Test that everything is installed correctly by running:
python main.py
You should see a window appear with a black canvas and three buttons at the bottom: Clear, Undo, and Calculate.If you encounter any errors, double-check that:
  • All dependencies are installed (pip list should show pillow and openai)
  • Your OpenAI API key is set correctly (echo $OPENAI_API_KEY on Unix or echo %OPENAI_API_KEY% on Windows)
  • You’re using Python 3.7 or higher (python --version)

Troubleshooting

Tkinter Not Found

If you see an error about Tkinter not being installed, you may need to install it separately: On Ubuntu/Debian:
sudo apt-get install python3-tk
On macOS: Tkinter comes pre-installed with Python. If it’s missing, reinstall Python from python.org. On Windows: Tkinter is included with the standard Python installation. Reinstall Python and ensure “tcl/tk and IDLE” is selected during installation.

OpenAI API Errors

If you see authentication errors when running the application:
  1. Verify your API key is valid at platform.openai.com/api-keys
  2. Ensure the environment variable is set correctly
  3. Restart your terminal after setting the environment variable
  4. Check that your OpenAI account has available credits

Font Issues

The application uses the “Noteworthy” font for displaying answers. If this font isn’t available on your system, the application will fall back to the default font. This won’t affect functionality, only the visual appearance of answers.

Next Steps

Now that you have AI Math Notes installed, head over to the Quick Start guide to draw and calculate your first equation!

Build docs developers (and LLMs) love