Installation
This guide covers different ways to install and use the Cookiecutter Python Package template.
Prerequisites
Before using this template, ensure you have the following installed:
Python Requirements
- Python 3.9 or higher (3.11+ recommended for best performance)
- pip (Python package installer)
Check your Python version:
Git (Required)
Git is required for cloning repositories and version control:
Windows
Download from git-scm.com or use:
macOS
Linux (Ubuntu/Debian)
Installing Cookiecutter
Method 1: Using pip (Recommended)
Method 2: Using pipx (Isolated Installation)
# Install pipx if not already installed
pip install pipx
# Install cookiecutter with pipx
pipx install cookiecutter
Method 3: Using uv (Fastest)
Method 4: Using conda
Verify Installation
Check that cookiecutter is installed correctly:
You should see output similar to:
Platform-Specific Notes
Windows
If you encounter issues with long path names, enable long path support:
# Run as Administrator
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
macOS
If you have issues with the default Python, consider using:
# Install Python via Homebrew
brew install python@3.11
# Use the Homebrew Python
/opt/homebrew/bin/python3.11 -m pip install cookiecutter
Linux
Make sure you have the development tools installed:
# Ubuntu/Debian
sudo apt install build-essential python3-dev
# CentOS/RHEL/Fedora
sudo yum groupinstall "Development Tools"
sudo yum install python3-devel
Network and Firewall Considerations
Corporate Networks
If you're behind a corporate firewall, you may need to configure proxy settings:
# Set proxy for pip
pip install --proxy http://proxy.company.com:8080 cookiecutter
# Set proxy environment variables
export HTTP_PROXY=http://proxy.company.com:8080
export HTTPS_PROXY=http://proxy.company.com:8080
SSH vs HTTPS
The template can be accessed via HTTPS (default) or SSH:
# HTTPS (works everywhere)
cookiecutter https://github.com/s-celles/cookiecutter-python-package.git
# SSH (requires SSH key setup)
cookiecutter git@github.com:s-celles/cookiecutter-python-package.git
Alternative Installation Methods
Direct Download
If you can't use git, download the template directly:
- Visit the GitHub repository
- Click "Code" → "Download ZIP"
- Extract the ZIP file
- Use the local path:
Docker (Experimental)
For completely isolated usage:
# Build the image
docker build -t cookiecutter-python-package .
# Run the template
docker run -it -v $(pwd):/output cookiecutter-python-package
Troubleshooting Installation
Common Issues
"cookiecutter: command not found"
Solution: Ensure the Python Scripts directory is in your PATH:
Windows:
# Add to PATH (replace with your Python path)
$env:PATH += ";C:\Users\YourUser\AppData\Local\Programs\Python\Python311\Scripts"
macOS/Linux:
Permission Errors
Windows: Run command prompt as Administrator
macOS/Linux: Use sudo
or install in user directory:
SSL Certificate Errors
# Upgrade certificates
pip install --upgrade certifi
# Or bypass SSL (not recommended for production)
pip install --trusted-host pypi.org --trusted-host pypi.python.org cookiecutter
ImportError or Module Not Found
Ensure you're using the correct Python environment:
# Check which Python pip is using
pip --version
# Use specific Python version
python3.11 -m pip install cookiecutter
Getting Help
If you encounter issues:
- Check the logs: Use
cookiecutter --verbose
for detailed output - Update cookiecutter:
pip install --upgrade cookiecutter
- Check GitHub Issues: Template Issues
- Community Support: Python Discord, Reddit r/Python
Next Steps
Once cookiecutter is installed, you're ready to:
Development Installation
If you want to contribute to the template itself:
# Clone the repository
git clone https://github.com/s-celles/cookiecutter-python-package.git
cd cookiecutter-python-package
# Install development dependencies
pip install -e .[dev]
# Run tests
pytest
# Test the template locally
cookiecutter .
This ensures you have a working cookiecutter installation and can successfully create Python packages using this template.