Complete setup instructions for the Dictionary system. Environment configuration, dependencies, and troubleshooting.
Problem: Running scripts from wrong directories with complex relative paths and missing dependencies.
Solution:
ags-dictionary conda environmentFrom ANY directory in your project:
1# 1. Activate your conda environment
2conda activate ags-dictionary
3
4# 2. Run the wrapper script (absolute path)
5/home/ag-sayyed/Documents/projects/hbstack/ghafoors-blog/scripts/dictionary/dict-extract.sh \
6 --video-url "https://www.youtube.com/watch?v=9M_dq_0ljsc" \
7 --topic "capitalism" \
8 --create-hugo-page \
9 --source-name "Capitalism is not natural"
That’s it! The script handles all paths correctly.
Add this to your ~/.bashrc:
1# Dictionary extraction tool
2alias dict-extract="/home/ag-sayyed/Documents/projects/hbstack/ghafoors-blog/scripts/dictionary/dict-extract.sh"
Then reload:
1source ~/.bashrc
Now you can run from ANYWHERE:
1conda activate ags-dictionary
2
3dict-extract \
4 --video-url "https://www.youtube.com/watch?v=9M_dq_0ljsc" \
5 --topic "capitalism" \
6 --create-hugo-page \
7 --source-name "Capitalism is not natural"
In your ags-dictionary conda environment:
youtube-transcript-api - Fetch YouTube transcriptsopenai - GPT-4 API accessPyYAML - YAML file handlingpython-dotenv - Environment variable managementrequests - HTTP requestsbeautifulsoup4 - HTML parsing (optional)scripts/dictionary/dict-extract.sh - Main wrapper script (RECOMMENDED)
scripts/dictionary/extract_vocab.py - Python wrapper
You need an OpenAI API key to use the script. Set it one of these ways:
1echo 'export OPENAI_API_KEY="sk-your-key-here"' >> ~/.bashrc
2source ~/.bashrc
1cat > /home/ag-sayyed/Documents/projects/hbstack/ghafoors-blog/.env << 'EOF'
2OPENAI_API_KEY=sk-your-key-here
3EOF
1cat > /home/ag-sayyed/Documents/projects/hbstack/ghafoors-blog/scripts/dictionary/.env << 'EOF'
2OPENAI_API_KEY=sk-your-key-here
3EOF
Get your API key from: https://platform.openai.com/api-keys
Test that everything works:
1# Activate environment
2conda activate ags-dictionary
3
4# Check dependencies
5python -c "import yaml, openai, youtube_transcript_api; print('✅ All good!')"
6
7# Check script help
8/home/ag-sayyed/Documents/projects/hbstack/ghafoors-blog/scripts/dictionary/dict-extract.sh --help
Your fixed command (works from anywhere):
1conda activate ags-dictionary
2
3/home/ag-sayyed/Documents/projects/hbstack/ghafoors-blog/dict-extract.sh \
4 --video-url "https://www.youtube.com/watch?v=9M_dq_0ljsc" \
5 --topic "capitalism" \
6 --create-hugo-page \
7 --source-name "Capitalism is not natural"
data/dictionary/capitalism/vocabulary.yamlcontent/docs/dictionary/capitalism/index.mdnpm run dev:memoryTime: 5-10 minutes (most is AI processing)
You’re all set! 🚀
Created: 2026-05-05
Issue: Path resolution and missing dependencies
Status: ✅ RESOLVED