Mixing Different Version Of Python Libraries And Pass Environment Variables Beforehand

mpython3
Python scripts
Environment variables
JAVA_HOME
PYTHONPATH
Library version mixing
This article provides a guide on using the `mpython3` command to execute Python scripts. It explains how to set environment variables such as JAVA_HOME and PYTHONPATH beforehand, ensuring correct compatibility with different library versions.
Published

November 4, 2022


command of mpython3

env JAVA_HOME=/opt/homebrew/Cellar/openjdk/18.0.2 PYTHONPATH=$(python3 -c "import sys; print(':'.join(sys.path))"):/opt/homebrew/lib/python3.10/site-packages python3 $@