The Python template uses system Python to create the virtual environment
Running the following
apify create xyz --template=python-crawlee-beautifulsoup
results in the following output:
Info: Python version 3.13.2 detected.
Info: Creating a virtual environment in "/Users/honza/Projects/xyz/.venv" and installing dependencies from "requirements.txt"...
Run: python3 -m venv --prompt . .venv
Run: /Users/honza/Projects/xyz/.venv/bin/python3 -m pip install --no-cache-dir --no-warn-script-location --upgrade pip setuptools wheel
The line python3 -m venv --prompt . .venv indicates that the template uses system Python:
$ which python3
/opt/homebrew/bin/python3
That's not best practice. System Python (here installed by Homebrew) is supposed to be used exclusively as a dependency for other programs (other Homebrew packages). Starting virtual environments linked to this Python installation makes them fragile, because whenever the system Python updates (e.g. just a security patch version), path to the Python binary changes. All virtual environments break and need to be re-created.
In the past, a solution to this would be to use a separate way to manage Python installations, such as pyenv. In 2025, this is best solved by using uv.
(That makes https://github.com/apify/actor-templates/issues/350 slightly related to this issue.)