In a Linux compute cluster environment that we have we would previously install different versions of python that we needed under /opt on the cluster headnode, and configure /etc/exports to NFS export /opt/pythonX.Y to the compute nodes for mounting from the headnode. However, we recently moved to a more resilient storage location on a SAN that is mounted on the whole cluster. We rsynced, for example, /opt/python2.7 and /opt/python3.3 from the headnode to the new path on the mounted SAN but the problem is that many of the *.py files under their bin/ subdirectory still have a shebang pointing to the old /opt path, thus keeping that as a dependency.
I thought that it would be easy to just freshly install python on the SAN instead by dumping the current packages that are in the /opt python installs with 'pip freeze > packagelist.txt' and then reinstalling with 'pip -r packagelist.txt', but what that did was install all of the eggs (expected) but almost none of the corresponding bin scripts (unexpected). I quickly discovered this when users started complaining that their bash scripts which use many of those *.py bins/scripts broke when their .bashrc was pointing to the new SAN path to run python, primarily because all the *.py scripts (which are under the /opt install path) were not under the SAN's pythonX.Y/bin/, although the corresponding eggs were all installed to the site-packages directory.
I have been trying to understand the relationship between the eggs and scripts as regards an install and the directory (output) location and I tracked down that the setup.py must have a 'scripts=' parameter specified in the setup() function as mentioned in this SE question: setup.py and adding file to /bin/.
I am a non-developer and do not even code in python, but can someone please help me understand why a pip "reinstall" using freeze/-r (--requirement) would install the eggs to site-packages/ but not the scripts to bin/? If they didn't come from the same package or install then where did they come from? If you need more specifics please let me know.