# Install pyenv
brew install pyenv
# Install Python 3.12.2
pyenv install 3.12.2
# Create a new virtual environment using Python 3.12.2
/Users/bamdad/.pyenv/versions/3.12.2/bin/python -m venv venv
# Activate virtual environment
source venv/bin/activate
# Upgrade pip
pip install --upgrade pip
# Install requirements
pip install -r requirements.txt
# OSX
python -m pip install --user virtualenv # osx
sudo pip install --upgrade virtualenv
pip install virtualenv
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
# check venv
pip -V
# activate venv
source venv/bin/activate
# Upgrade pip
pip install --upgrade pip
# deactivate venv
deactivate
# Check System aliases
aliaspip freeze | egrep 'Flask|flask|Werk|its|Jinja|jmespath|MarkupSafe|virtual|util|py|Py'
python wsgi.py
For development on Macs with Apple silicon, note the following from Apple support (https://support.apple.com/en-us/102527):
Apple transitioned from Intel processors to Apple silicon in 2020. Rosetta translates Intel-based apps for Apple silicon compatibility. Rosetta is available through macOS 27, but from macOS 28, it will only support certain older games.
For optimal performance, update apps to Universal or Apple silicon versions.
- Use the App Store for updates.
- Check app menus for built-in updates.
- Visit developer websites for Universal versions.
- Update plug-ins and extensions separately.
In Finder, select the app, Get Info (Cmd-I), check "Kind":
- Application (Intel): Needs update or Rosetta.
- Application (Universal): Compatible.
- Application (Apple silicon): Native.
Universal apps can optionally use Rosetta for Intel-only add-ons.
Rosetta installs automatically when opening an Intel app. It translates in the background. For best performance, update to native versions.
This ensures development tools run smoothly on Apple silicon Macs.