I ran into the same error while trying to install pip for python 2.4 via the get-pip.py file (on a windows machine). I tried to delete the python2to3 byte code notation 'b' and further replaced the with open()
file imports with python 2.4 file=open()
statements etc., but finally got stuck during calling main()
with an AttributeError: 'module' object has no attribute 'Struct'
(seems like the struct module does not have the Struct() attribute in python 2.4 - couldn't call it from the shell neither!).
However, what finally worked for me was the following:
1) If you don't have setuptools installed yet, get the bootstrap script for the setuptools installation from:
http://peak.telecommunity.com/dist/ez_setup.py
=> this one https://bitbucket.org/pypa/setuptools/raw/bootstrap-py24/ez_setup.py.
from https://pypi.org/project/setuptools/2.0/#python-2-4-and-python-2-5-support
did not work for me!
2) If you don't have the SSL module installed yet, you have to manually download the
setuptools-0.6c11-py2.4.egg file from
https://pypi.python.org/packages/2.4/s/setuptools/setuptools-0.6c11-py2.4.egg
=> Put the .egg file in the same folder as the ez_setup.py file.
3) With python 2.4 activated, go to the directory with
the ez_setup.py file, and run python ez_setup.py
within your console.
(setuptools-0.6c11-py2.4.egg disappears during the installation process)
4) After having setuptools successfully installed, get pip-1.1 from https://pypi.org/project/pip/1.1/ and unpack it.
5) Go to the pip-1.1 folder and run python setup.py install
from console.
P.S.: Don't forget to add the /Scripts folder with the pip.exe to your PATH variable!