-
Install pyenv-win in PowerShell.
Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1"
-
Reopen PowerShell
-
Run
pyenv --version
to check if the installation was successful. -
Run
type .python-version
to check what python version this repo uses -
Run
pyenv install <version>
to install the python version this repo uses -
Run
pyenv local <version>
to set a Python version as the local version
- Run
python -m venv venv
to create a venv called venv - Run
venv\Scripts\activate.bat
to activate the new venv - Run
python -m pip install -U pip setuptools poetry
to install poetry - Run
poetry install
to install all dependencies via poetry
If you fail poetry install
because of lz4
, download:
https://visualstudio.microsoft.com/visual-cpp-build-tools/
And then, run this on the directory you downloaded vs_buildtools.exe
:
vs_buildtools.exe --norestart --passive --downloadThenInstall --includeRecommended --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.MSBuildTools
And now you are ready to use this repo
Requirements: Puzzle inputs differ by user. For this reason, you can't get your data with an unauthenticated request. Here's how to get your session cookie for aocd to use:
Login on AoC with github or whatever Open browser's developer console (e.g. right click --> Inspect) and navigate to the Network tab GET any input page, say adventofcode.com/2016/day/1/input, and look in the request headers. It's a long hex string. Copy it to a plain text file at ~/.config/aocd/token.
- Make sure your venv is activated:
venv\Scripts\activate.bat
- Run get_input.py:
Example for getting Day1 of 2023
poetry run get_input 1 2023
- Make sure your venv is activated:
venv\Scripts\activate.bat
- Run from root(advent_of_code):
Example running Day1 of 2023
python advent-of-code\src\2023\Day1\main.py