This guide will help you get the Advent of Code Python solution runner up and running.
- Python 3.7 or higher
- pip (Python package installer)
- An Advent of Code account
git clone <repository-url>
cd AdventOfCodePythonpip install -r requirements.txtTo automatically fetch input and submit answers, you need your AOC session cookie:
-
Get Your Session Cookie:
- Log in to Advent of Code
- Open your browser's developer tools (F12)
- Go to the Network tab
- Refresh the page
- Find any request to
adventofcode.com - In the request headers, find the
Cookieheader - Copy the value of
session=<long_string>
-
Save the Session Cookie:
echo "your_session_cookie_here" > session_cookie.txt
Important: Keep your session cookie private! Add
session_cookie.txtto your.gitignoreif sharing this code.
Test your setup by running a solution:
# This should work if you have a solution for 2025 day 1
python main.py 2025 1If everything is set up correctly, you should see:
- Input automatically fetched
- Solution executed with timing
- Results displayed with performance comparison
For the best experience, install colorama for colorized terminal output:
pip install coloramaThe performance tracking database (aoc_tracking.db) will be created automatically in the project root when you first run a solution.
"Module not found" errors:
- Make sure you installed dependencies:
pip install -r requirements.txt - Check that you're using the correct Python version
"Session cookie invalid" errors:
- Verify your session cookie is correct and not expired
- Session cookies expire after about a month - you may need to get a new one
"Input file not found" errors:
- Make sure your session cookie is set up correctly
- The system should automatically fetch input files on first run
Permission errors:
- Make sure you have write permissions in the project directory
- The system needs to create/modify files for tracking and input storage
If you're still having issues:
- Check that all files are in the correct locations
- Verify your Python version:
python --version - Try running with verbose output (if available)
- Check the GitHub issues for similar problems
Once everything is working:
- Read the CLI Reference for all available commands
- Check out the Solution Writing Guide for tips on writing solutions
- Explore Performance Tracking to understand the benchmarking features