This guide covers Python installation on macOS using python-build-standalone portable builds.
- macOS 10.15 (Catalina) or later
- curl (included with macOS)
- tar (included with macOS)
- Internet access
- ~150 MB free disk space
# Make script executable
chmod +x bootstrap-unix.sh
# Run the bootstrap script
./bootstrap-unix.sh
# For a fresh reinstall
./bootstrap-unix.sh --force| Mac Type | Architecture | Build Used |
|---|---|---|
| Intel Mac | x86_64 | x86_64-apple-darwin |
| Apple Silicon (M1/M2/M3) | aarch64 | aarch64-apple-darwin |
The script automatically detects your architecture.
Default: $HOME/.python-nonadmin
This typically resolves to:
/Users/YourUsername/.python-nonadmin
.python-nonadmin/
├── bin/
│ ├── python3 # Main Python interpreter
│ ├── python3.12 # Version-specific symlink
│ ├── pip3 # Package installer
│ └── ...
├── lib/
│ └── python3.12/ # Standard library
│ ├── site-packages/
│ └── ...
├── include/ # Header files
└── share/ # Documentation
macOS may quarantine downloaded files. The bootstrap script handles this automatically, but if you encounter issues:
# Remove quarantine attribute manually
xattr -dr com.apple.quarantine ~/.python-nonadminIf you see "cannot be opened because the developer cannot be verified":
- Open System Preferences > Security & Privacy > General
- Click "Allow Anyway" for the blocked application
- Or use the xattr command above
The script automatically adds Python to your PATH by modifying your shell profile:
| Shell | Profile Modified |
|---|---|
| Bash | ~/.bash_profile or ~/.bashrc |
| Zsh (default on macOS) | ~/.zshrc |
| Fish | ~/.config/fish/config.fish |
Since macOS Catalina, Zsh is the default shell. The configuration is added to ~/.zshrc:
# Check your shell
echo $SHELL
# View added configuration
tail ~/.zshrcIf you have Python installed via Homebrew:
# Check which python is active
which python3
# Homebrew Python
/opt/homebrew/bin/python3 # Apple Silicon
/usr/local/bin/python3 # Intel
# User Python
~/.python-nonadmin/bin/python3PATH order determines which is used first. The user Python is added to the front of PATH.
For corporate environments:
# Set before running bootstrap
export HTTP_PROXY="http://proxy.company.com:8080"
export HTTPS_PROXY="http://proxy.company.com:8080"
# Run
./bootstrap-unix.shFor permanent pip proxy:
pip config set global.proxy http://proxy.company.com:8080Restart your terminal or source your profile:
# For Zsh
source ~/.zshrc
# For Bash
source ~/.bash_profilemacOS may have certificate issues. Install certificates:
# If you have system Python with certifi
/Applications/Python\ 3.*/Install\ Certificates.command
# Or install certifi in user Python
pip3 install certifiIf running x86_64 apps on Apple Silicon, you may need Rosetta:
# Install Rosetta 2 (may require admin for first-time install)
softwareupdate --install-rosettaHowever, the native aarch64 build is recommended for best performance.
Check System Preferences > Security & Privacy > Privacy > Full Disk Access if you're running from a restricted context like an IDE terminal.
# Remove installation directory
rm -rf ~/.python-nonadmin
# Remove PATH configuration from shell profile
# For Zsh:
sed -i '' '/Python-NoAdmin/d' ~/.zshrc
# For Bash:
sed -i '' '/Python-NoAdmin/d' ~/.bash_profile