How do I find out which directories are listed in my system’s PYTHONPATH variable, from within a Python script (or the interactive shell)?
If using conda, you can get the env prefix using os.environ["CONDA_PREFIX"].
How do I find out my PYTHONPATH using Python?