I'm seeking guidance on managing Python virtual environments efficiently on macOS. Currently, I'm running Python 3.9.6 as a system-wide installation and aim to create multiple isolated virtual environments tailored to different projects' needs.
Some of these environments require separate Python distributions, while others utilize existing installations from other applications on my machine.
My primary concern is maintaining isolation while managing custom environment variables, including modifications to $PATH, upon activating and deactivating environments.
Initially, I explored Anaconda for environment management but encountered compatibility issues with a CGI application named Houdini. Despite matching Python versions precisely (current version of Houdini uses Python 3.10.10), Anaconda's standalone library clashed with Houdini's Python framework on macOS.
My next consideration is pyenv, but I'm unsure if it addresses my requirements effectively. Additionally, I'm uncertain about managing a mix of locally installed Python versions alongside those downloaded via pyenv.
I'd greatly appreciate insights or recommendations on the best practices for handling these scenarios efficiently. Thank you in advance for your assistance.
PS. Here is the response I received from SideFx (creators of Houdini) - "In my experience, Conda Python is incompatible with Houdini on macOS. The reason being is that Conda Python on Mac is built as a standalone library (i.e. libpython*.dylib), mirroring how it is built on Linux. This is not compatible with Houdini, where Houdini's Python is built as a Mac framework (i.e. $HFS/Frameworks/Python.framework). Basically, launching Conda Python loads the standalone Python library and then importing hou loads the Python framework (since the framework is different/incompatible than the library) and so two different Python distros are loaded in the process and you get fatal Python errors. So the hou module cannot be imported into Conda Python."