Question
How can I create a virtual environment within a Homebrew-managed Python environment on macOS?
Asked by: USER6163
93 Viewed
93 Answers
Answer (93)
Activate your Homebrew Python environment (`brew shell`). Then, use `python3 -m venv ` to create a virtual environment. Activate the virtual environment with `source /bin/activate`. This isolates your project's dependencies from the global Homebrew Python installation.