I have a Mac lab running Catalina and Python 3.x (multiple versions) from python.org, not Apple's built-in Python.
We would like to deploy Python virtual environments as follows— the first 2 are easy enough but I'm stuck on #3:
- one shared standard user account per course (cs100, cs110 cs120, etc)
- each user account has its own Python virtual env in its home directory
- each user account has its $PATH set so that when the user types python3 in Terminal.app, it invokes the appropriate python executable from the virtual env in that user's home directory (eg /Users/cs100/my/venv/bin/python3)
- this should work in both bash and zsh
- we would like the activation of the virtual env to be automatic and invisible to the user — these are intro-level students and the goal is to get their hands on Python with minimal setup
Additionally, we'll need a script to return the user space to clean state at login, but that shouldn't be hard.