Q:

Combine multiple Python installations coming with GIS software

On my laptop I have QGIS and ArcGIS installed. Both come with separate Python installations, and next to these two there is also a 'standard' Python installation I have for development. Now I have 3 Pythons:

Standard Python - C:\Python27
QGIS Python - C:\OSGeo4W64\apps\Python27
ArcGIS Python - C:\Python27\ArcGIS10.4

Now say I'm eg. developing a QGIS plugin and need an external library to install. It is QGIS-Python which needs that, but what if it's a common lib like matplotlib or pandas which I would like to use normally, not only in QGIS plugins? Then I must install it as well into Standard-Python. And if for ArcGIS scripting, then also for ArcGIS-Python.
I don't really want to triple my Python installations and their additional libraries. But each one mentioned here differs from others, because it has some libs necessary to run modules of said software. Therefore I can't just delete them and change Python paths in settings. 
I would like to have one Python installation so I can access any module from one place. Is that possible? How to do this?
I didn't ask this question on SO because I think knowledge of GIS environment is essential here to help distinguish Pythons and know how to install them

A:

I would suggest using a shared location that has all your modules in one place.  At my work, we have a shared Python library where we store all our custom modules as well as all third party modules.  Because we have many GIS users, we wanted a way to easily distribute all functionality to everyone.
On a shared server location we have our main library, something like this:
\\GISServer\Python\Shared
In our case, we only have ArcGIS installed, but what we do when setting up ArcGIS on new machines can be done for any Python environment.  In the ArcGIS Install of Python, ESRI places a .pth file in the site-packages folder.  Any directories listed in this file will be available in your PYTHONPATH. This is how the ArcGIS Python interpreter knows how to find arcpy (since it is located in the C:\Program Files (x86) folder). 
The file (C:\Python27\ArcGIS10.3\Lib\site-packages\Desktop.pth) on my machine looks like this:
C:\Program Files (x86)\ArcGIS\Desktop10.3\bin
C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy
C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcToolBox\Scripts
\\GISServer\Python\Shared

As part of our ArcGIS software install, we run a script that appends the shared Python library path to the .pth file in the site-packages folder. This allows anyone to import any custom module or third party module from the shared location.
You can add a simple .pth file with just the network share path to the site-packages folder in all your Python installs.  Then all your installs should have access to the same resources.
You could also add a custom environment variable like PYTHON_SHARE, and then in all your scripts you could do:
sys.path.append(os.environ[PYTHON_SHARE])
There are a lot of ways you can do this, but I think these are some of the easiest options.

