Virtual environments are very useful as they allow you to test install components without affecting the shared libraries.

You create an environment called env with

python3 -m venv env

but this gave

Error: Command 'Ý'/u/py/env/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip'¨' returned non-zero exit status 1.

I think this was because my z/OS had no direct network connection. However

python3 -m venv --without-pip env --system-site-packages

worked. I needed the --system-site-packages, so I could build the extension.

Activate the environment

The instruction said use the command env/bin/activate but this failed

env/bin/activate: FSUM9209 cannot execute: reason code = ef076015: EDC5111I Permission denied.

but

. env/bin/activate

worked. (Just . env/b*/a* worked for me.)

To get out of the virtual environment use

deactivate

Use the environment

You should now be able to use the environment.

You should check that the HOME environment variable is a directory with read/write access.

You may want to set up PYTHONHOME for special python packages.