Python Code Notes – Mostly Useless

Wrangled Python for a few hours. Luckily I came upon this site. I was pretty peeved about the seeming hatred of Mac in the Python Community. The guy who runs this site is a saint.
http://www.python.org/download/mac/
http://www.pythonmac.org/packages/py24-fat/index.html
All I wanted to do was make networkx work so I could make simple network digrams. I finally did it after I installed these from his site (yeah – I went a bit overboard – in case I wanted to play later):
Python 2.4.4
matplotlib
aggdraw
pygame
pysqlite
pyXML
scipy
wxPython2.8
PIL
numpy
I could never find a pyGTK for the mac – it is under development. I could run about 2/3 of the tests from matplotlib. But I did see a networkx graph displayed. Time for some popcorn and to watch a football game.
Gibberish notes below. Note that I went down a long path with 2.3 and came up short – so I just went to 2.4. I hope Mac OS 10.5 has 2.4 or later on it. Hey I should reboot to the other partition and check :)


sys.path.append(‘/Users/csev/python/modules/lib/python/’)
http://docs.python.org/inst/inst.html
python setup.py install –home=/Users/csev/python/modules
vi ~/.pydistutils.cfg
curl -O http://peak.telecommunity.com/dist/ez_setup.py
mkdir /Users/csev/Library/Python/
mkdir /Users/csev/Library/Python/2.3
mkdir /Users/csev/Library/Python/2.3/site-packages/
python ez_setup.py
Downloading http://pypi.python.org/packages/2.3/s/setuptools/setuptools-0.6c7-py2.3.egg
Processing setuptools-0.6c7-py2.3.egg
creating /Volumes/UserHome/Users/csev/Library/Python/2.3/site-packages/setuptools-0.6c7-py2.3.egg
Extracting setuptools-0.6c7-py2.3.egg to /Volumes/UserHome/Users/csev/Library/Python/2.3/site-packages
Adding setuptools 0.6c7 to easy-install.pth file
Installing easy_install script to /Users/csev/bin
Installing easy_install-2.3 script to /Users/csev/bin
Installed /Volumes/UserHome/Users/csev/Library/Python/2.3/site-packages/setuptools-0.6c7-py2.3.egg
Processing dependencies for setuptools==0.6c7
Finished processing dependencies for setuptools==0.6c7
easy_install networkx
Searching for networkx
Reading http://pypi.python.org/simple/networkx/
Reading http://networkx.lanl.gov/
Reading http://networkx.lanl.gov/download
Reading http://sourceforge.net/project/showfiles.php?group_id=122233
Reading https://networkx.lanl.gov
Reading http://networkx.lanl.gov
Best match: networkx 0.35.1
Downloading http://pypi.python.org/packages/source/n/networkx/networkx-0.35.1.zip#md5=d2be068d7506fb1914a0fbf9074a4096
Processing networkx-0.35.1.zip
Running networkx-0.35.1/setup.py -q bdist_egg –dist-dir /tmp/easy_install-v7eD4D/networkx-0.35.1/egg-dist-tmp-IXIf_m
warning: no files found matching ‘doc/examples/*.dat’
warning: no previously-included files matching ‘*~’ found anywhere in distribution
warning: no previously-included files matching ‘*.pyc’ found anywhere in distribution
warning: no previously-included files matching ‘.svn’ found anywhere in distribution
File “build/bdist.darwin-8.10.3-i386/egg/networkx/tests/benchmark.py”, line 23
self.class_tests = dict((gc,”) for gc in graph_classes)
^
SyntaxError: invalid syntax
zip_safe flag not set; analyzing archive contents…
networkx.tests.test: module references __file__
File “/Volumes/UserHome/Users/csev/Library/Python/2.3/site-packages/networkx-0.35.1-py2.3.egg/networkx/tests/benchmark.py”, line 23
self.class_tests = dict((gc,”) for gc in graph_classes)
^
SyntaxError: invalid syntax
Adding networkx 0.35.1 to easy-install.pth file
Installed /Volumes/UserHome/Users/csev/Library/Python/2.3/site-packages/networkx-0.35.1-py2.3.egg
Processing dependencies for networkx
Finished processing dependencies for networkx
tar xfv numpy-1.0.3.1.tar
cd numpy-1.0.3.1
ls
python setup.py install –home=/Volumes/UserHome/Users/csev/Library/Python/2.3/site-packages/
easy_install pygtk
===== Start Over Switch to 2.4 ======
si-csev-mbp:~ csev$ mkdir /Users/csev/Library/Python/2.4
si-csev-mbp:~ csev$ mkdir /Users/csev/Library/Python/2.4/site-packages
si-csev-mbp:~ csev$ python ez_setup.py
Downloading http://pypi.python.org/packages/2.4/s/setuptools/setuptools-0.6c7-py2.4.egg
Processing setuptools-0.6c7-py2.4.egg
creating /Volumes/UserHome/Users/csev/Library/Python/2.4/site-packages/setuptools-0.6c7-py2.4.egg
Extracting setuptools-0.6c7-py2.4.egg to /Volumes/UserHome/Users/csev/Library/Python/2.4/site-packages
Adding setuptools 0.6c7 to easy-install.pth file
Installing easy_install script to /Users/csev/bin
Installing easy_install-2.4 script to /Users/csev/bin
Installed /Volumes/UserHome/Users/csev/Library/Python/2.4/site-packages/setuptools-0.6c7-py2.4.egg
Processing dependencies for setuptools==0.6c7
Finished processing dependencies for setuptools==0.6c7
si-csev-mbp:~ csev$
si-csev-mbp:~ csev$ easy_install networkx
Searching for networkx
Reading http://pypi.python.org/simple/networkx/
Reading http://networkx.lanl.gov/
Reading http://networkx.lanl.gov/download
Reading http://sourceforge.net/project/showfiles.php?group_id=122233
Reading https://networkx.lanl.gov
Reading http://networkx.lanl.gov
Best match: networkx 0.35.1
Downloading http://pypi.python.org/packages/2.4/n/networkx/networkx-0.35.1-py2.4.egg#md5=a6382079e85eda3179879cea77751def
Processing networkx-0.35.1-py2.4.egg
creating /Volumes/UserHome/Users/csev/Library/Python/2.4/site-packages/networkx-0.35.1-py2.4.egg
Extracting networkx-0.35.1-py2.4.egg to /Volumes/UserHome/Users/csev/Library/Python/2.4/site-packages
Adding networkx 0.35.1 to easy-install.pth file
Installed /Volumes/UserHome/Users/csev/Library/Python/2.4/site-packages/networkx-0.35.1-py2.4.egg
Processing dependencies for networkx
Finished processing dependencies for networkx
easy_install pyGTK — did not work.