Watch: Fix "externally-managed-environment" pip error: Python venv on Mac | Vovy
Watch Vovy do it on a Mac: "Install Python and set up a venv so I can run this script from GitHub". Vovy installs Python, makes a virtual environment for the project, installs requirements.txt, and avoids the "externally-managed-environment" pip error.
"Install Python and set up a venv so I can run this script from GitHub"
Vovy installs Python, makes a virtual environment for the project, installs requirements.txt, and avoids the "externally-managed-environment" pip error.
What happens in the video
- Check for Python: Vovy runs python3 --version. macOS ships only a stub that points to Apple's tools, so most people need a proper install.
- Install Python: Vovy installs a current Python with Homebrew and confirms python3 now points to that copy.
- Create a virtual environment: Vovy runs python3 -m venv .venv in your project. A venv is a private box of packages for one project, so projects never clash.
- Install the requirements: Vovy activates the venv and runs pip install -r requirements.txt, which sidesteps the externally-managed-environment error you get with system-wide pip.
- Run the script: Vovy runs your script, shows the output, and adds .venv to .gitignore with a card on how to activate it next time.
Read the step-by-step guideLoading...