This guide will walk you through setting up the YouTube Uploader Python application on macOS, including virtual environment setup and YouTube API credentials configuration.
- macOS (tested on macOS 24.3.0)
- Python 3.x installed
- Terminal application
- Google account for YouTube API access
Open Terminal and navigate to where you saved the Python program:
cd /path/to/your/project
# For example: cd ~/Desktop/youtube-uploaderCreate a virtual environment named venv:
python3 -m venv venvNote: If you get an error, try using python instead of python3:
python -m venv venvActivate the virtual environment:
source venv/bin/activateSuccess indicator: You'll see (venv) at the beginning of your terminal prompt.
pip install --upgrade pipInstall the YouTube API dependencies:
pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-clientCheck if packages are installed correctly:
pip listExpected result: You should see the Google API packages listed in the output.
- Visit Google Cloud Console
- Sign in with your Google account
- Create a new project or select an existing one
- Make note of your project ID
- Navigate to "APIs & Services" > "Library"
- Search for "YouTube Data API v3"
- Click on it and press "Enable"
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "OAuth 2.0 Client IDs"
- Choose "Desktop Application"
- Download the JSON file
- Rename the downloaded file to
credentials.json - Place
credentials.jsonin the same directory as your Python program
Make sure your virtual environment is still activated (you should see (venv) in your prompt), then run:
python video_uploader.pyWhen you're finished working with the program, deactivate the virtual environment:
deactivateEvery time you want to run the program:
- Navigate to your project directory
- Activate the virtual environment:
source venv/bin/activate - Run the program:
python video_uploader.py - Deactivate when done:
deactivate
source venv/bin/activate python video_uploader.py
- Python not found: Ensure Python is installed and in your PATH
- Permission denied: Use
sudoif necessary for system-wide installations - API errors: Verify your credentials.json file is in the correct location
- Virtual environment issues: Delete the
venvfolder and recreate it
If you encounter issues:
- Check that all dependencies are properly installed
- Verify your YouTube API credentials are correct
- Ensure your virtual environment is activated
- Check the console output for specific error messages
After setup, your project directory should look like this:
youtube-uploader/
├── venv/ # Virtual environment folder
├── credentials.json # YouTube API credentials
├── video_uploader.py # Main application file
├── requirements.txt # Python dependencies
└── setup_guide.md # This file
Note: Keep your credentials.json file secure and never commit it to version control.