I am learning Python, I have very limited understanding of Unix, path management, etc. My goal is to use Python2.5.x with multiple modules. A native Python2.7 installation can see all of my modules. Native 2.5 cannot. In addition, I installed the binary for version 2.5.4 on Python.org. I am using the latest version of Xcode (4.6) with command line tools installed and m OS X (10.8.3)
When I built the Python 2.5 assembly the PIL library (i.e. python setup.py -build_ext -i; python setup.py install), this was not a problem initially, except that it was not available for the native version 2.5, but rather 2.7! So, after installing 2.5.4, I tried creating the PIL again, hoping that it would follow the updated path variables. Alas, 2.5.4 wants to use GCC 4.0.1 and therefore cannot complete the build.
By simulating the modules from where they are to the places where I need them (or in the case of pygame , just a copy of the whole directory was made, because for some reason symlinking does not work), I can download my current installation to download them . But I know that this is the wrong way to do this, and I just don’t understand how, for example, something is set for
Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/site-packages
supposed to be made available for other versions.
TL; DR:
It is a feeling of helplessness in terms of getting things to work together, which is so frustrating. How should this work? What is the point of a binary installer, or even installation scripts, if I cannot control which versions of Python can access these modules? I would be very grateful if someone could point me to a brief explanation of what happens when the modules are installed and when the python loads them, so that I can learn how to diagnose these problems myself.
Here is all the information that I could come up with, which, in my opinion, could be useful.
$which python returns Python 2.5.4
$python print sys.pathuses Python 2.5.4 / GCC 4.0.1and returns:
'',
'/Library/Frameworks/Python.framework/Versions/2.5/lib/python25.zip'
'/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5'
'/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin'
'/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac'
'/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib-scriptpackages'
'/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk'
'/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload'
'/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages'
$python2.5 print sys.pathuses Python 2.5.4 / GCC 4.0.1and returns the same as above
$python2.7 print sys.pathuses Python 2.7.2 / GCC 4.2.1and returns:
'',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip'
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7'
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin'
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac'
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages'
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python'
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk'
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old'
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload'
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC'
'/Library/Python/2.7/site-packages'
'/Library/Python/2.7/site-packages/PIL'