{"id":375,"date":"2007-10-27T22:01:52","date_gmt":"2007-10-28T02:01:52","guid":{"rendered":"http:\/\/www.dr-chuck.com\/wordpress\/?p=375"},"modified":"2011-12-17T12:24:12","modified_gmt":"2011-12-17T16:24:12","slug":"python-code-notes-mostly-useless","status":"publish","type":"post","link":"https:\/\/www.dr-chuck.com\/csev-blog\/2007\/10\/python-code-notes-mostly-useless\/","title":{"rendered":"Python Code Notes &#8211; Mostly Useless"},"content":{"rendered":"<p>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.<br \/>\nhttp:\/\/www.python.org\/download\/mac\/<br \/>\nhttp:\/\/www.pythonmac.org\/packages\/py24-fat\/index.html<br \/>\nAll 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 &#8211; I went a bit overboard &#8211; in case I wanted to play later):<br \/>\n<a href=\"http:\/\/www.dr-chuck.com\/images\/2007\/10\/index.php?img=28-10-07_095744_01.jpg\" target=\"_new\"><img decoding=\"async\" src=\"http:\/\/www.dr-chuck.com\/images\/2007\/10\/28-10-07_095744_01.jpg\" align=right width=240\/><\/a>Python 2.4.4<br \/>\nmatplotlib<br \/>\naggdraw<br \/>\npygame<br \/>\npysqlite<br \/>\npyXML<br \/>\nscipy<br \/>\nwxPython2.8<br \/>\nPIL<br \/>\nnumpy<br \/>\nI could never find a pyGTK for the mac &#8211; 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.<br \/>\nGibberish notes below.  Note that I went down a long path with 2.3 and came up short &#8211; 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 :)<\/p>\n<p><!--more--><br \/>\nsys.path.append(&#8216;\/Users\/csev\/python\/modules\/lib\/python\/&#8217;)<br \/>\nhttp:\/\/docs.python.org\/inst\/inst.html<br \/>\npython setup.py install &#8211;home=\/Users\/csev\/python\/modules<br \/>\nvi ~\/.pydistutils.cfg<br \/>\ncurl -O http:\/\/peak.telecommunity.com\/dist\/ez_setup.py<br \/>\nmkdir  \/Users\/csev\/Library\/Python\/<br \/>\nmkdir  \/Users\/csev\/Library\/Python\/2.3<br \/>\nmkdir  \/Users\/csev\/Library\/Python\/2.3\/site-packages\/<br \/>\npython ez_setup.py<br \/>\nDownloading http:\/\/pypi.python.org\/packages\/2.3\/s\/setuptools\/setuptools-0.6c7-py2.3.egg<br \/>\nProcessing setuptools-0.6c7-py2.3.egg<br \/>\ncreating \/Volumes\/UserHome\/Users\/csev\/Library\/Python\/2.3\/site-packages\/setuptools-0.6c7-py2.3.egg<br \/>\nExtracting setuptools-0.6c7-py2.3.egg to \/Volumes\/UserHome\/Users\/csev\/Library\/Python\/2.3\/site-packages<br \/>\nAdding setuptools 0.6c7 to easy-install.pth file<br \/>\nInstalling easy_install script to \/Users\/csev\/bin<br \/>\nInstalling easy_install-2.3 script to \/Users\/csev\/bin<br \/>\nInstalled \/Volumes\/UserHome\/Users\/csev\/Library\/Python\/2.3\/site-packages\/setuptools-0.6c7-py2.3.egg<br \/>\nProcessing dependencies for setuptools==0.6c7<br \/>\nFinished processing dependencies for setuptools==0.6c7<br \/>\neasy_install networkx<br \/>\nSearching for networkx<br \/>\nReading http:\/\/pypi.python.org\/simple\/networkx\/<br \/>\nReading http:\/\/networkx.lanl.gov\/<br \/>\nReading http:\/\/networkx.lanl.gov\/download<br \/>\nReading http:\/\/sourceforge.net\/project\/showfiles.php?group_id=122233<br \/>\nReading https:\/\/networkx.lanl.gov<br \/>\nReading http:\/\/networkx.lanl.gov<br \/>\nBest match: networkx 0.35.1<br \/>\nDownloading http:\/\/pypi.python.org\/packages\/source\/n\/networkx\/networkx-0.35.1.zip#md5=d2be068d7506fb1914a0fbf9074a4096<br \/>\nProcessing networkx-0.35.1.zip<br \/>\nRunning networkx-0.35.1\/setup.py -q bdist_egg &#8211;dist-dir \/tmp\/easy_install-v7eD4D\/networkx-0.35.1\/egg-dist-tmp-IXIf_m<br \/>\nwarning: no files found matching &#8216;doc\/examples\/*.dat&#8217;<br \/>\nwarning: no previously-included files matching &#8216;*~&#8217; found anywhere in distribution<br \/>\nwarning: no previously-included files matching &#8216;*.pyc&#8217; found anywhere in distribution<br \/>\nwarning: no previously-included files matching &#8216;.svn&#8217; found anywhere in distribution<br \/>\nFile &#8220;build\/bdist.darwin-8.10.3-i386\/egg\/networkx\/tests\/benchmark.py&#8221;, line 23<br \/>\nself.class_tests = dict((gc,&#8221;) for gc in graph_classes)<br \/>\n^<br \/>\nSyntaxError: invalid syntax<br \/>\nzip_safe flag not set; analyzing archive contents&#8230;<br \/>\nnetworkx.tests.test: module references __file__<br \/>\nFile &#8220;\/Volumes\/UserHome\/Users\/csev\/Library\/Python\/2.3\/site-packages\/networkx-0.35.1-py2.3.egg\/networkx\/tests\/benchmark.py&#8221;, line 23<br \/>\nself.class_tests = dict((gc,&#8221;) for gc in graph_classes)<br \/>\n^<br \/>\nSyntaxError: invalid syntax<br \/>\nAdding networkx 0.35.1 to easy-install.pth file<br \/>\nInstalled \/Volumes\/UserHome\/Users\/csev\/Library\/Python\/2.3\/site-packages\/networkx-0.35.1-py2.3.egg<br \/>\nProcessing dependencies for networkx<br \/>\nFinished processing dependencies for networkx<br \/>\ntar xfv numpy-1.0.3.1.tar<br \/>\ncd numpy-1.0.3.1<br \/>\nls<br \/>\npython setup.py install &#8211;home=\/Volumes\/UserHome\/Users\/csev\/Library\/Python\/2.3\/site-packages\/<br \/>\neasy_install pygtk<br \/>\n===== Start Over Switch to 2.4 ======<br \/>\nsi-csev-mbp:~ csev$ mkdir \/Users\/csev\/Library\/Python\/2.4<br \/>\nsi-csev-mbp:~ csev$ mkdir \/Users\/csev\/Library\/Python\/2.4\/site-packages<br \/>\nsi-csev-mbp:~ csev$ python ez_setup.py<br \/>\nDownloading http:\/\/pypi.python.org\/packages\/2.4\/s\/setuptools\/setuptools-0.6c7-py2.4.egg<br \/>\nProcessing setuptools-0.6c7-py2.4.egg<br \/>\ncreating \/Volumes\/UserHome\/Users\/csev\/Library\/Python\/2.4\/site-packages\/setuptools-0.6c7-py2.4.egg<br \/>\nExtracting setuptools-0.6c7-py2.4.egg to \/Volumes\/UserHome\/Users\/csev\/Library\/Python\/2.4\/site-packages<br \/>\nAdding setuptools 0.6c7 to easy-install.pth file<br \/>\nInstalling easy_install script to \/Users\/csev\/bin<br \/>\nInstalling easy_install-2.4 script to \/Users\/csev\/bin<br \/>\nInstalled \/Volumes\/UserHome\/Users\/csev\/Library\/Python\/2.4\/site-packages\/setuptools-0.6c7-py2.4.egg<br \/>\nProcessing dependencies for setuptools==0.6c7<br \/>\nFinished processing dependencies for setuptools==0.6c7<br \/>\nsi-csev-mbp:~ csev$<br \/>\nsi-csev-mbp:~ csev$ easy_install networkx<br \/>\nSearching for networkx<br \/>\nReading http:\/\/pypi.python.org\/simple\/networkx\/<br \/>\nReading http:\/\/networkx.lanl.gov\/<br \/>\nReading http:\/\/networkx.lanl.gov\/download<br \/>\nReading http:\/\/sourceforge.net\/project\/showfiles.php?group_id=122233<br \/>\nReading https:\/\/networkx.lanl.gov<br \/>\nReading http:\/\/networkx.lanl.gov<br \/>\nBest match: networkx 0.35.1<br \/>\nDownloading http:\/\/pypi.python.org\/packages\/2.4\/n\/networkx\/networkx-0.35.1-py2.4.egg#md5=a6382079e85eda3179879cea77751def<br \/>\nProcessing networkx-0.35.1-py2.4.egg<br \/>\ncreating \/Volumes\/UserHome\/Users\/csev\/Library\/Python\/2.4\/site-packages\/networkx-0.35.1-py2.4.egg<br \/>\nExtracting networkx-0.35.1-py2.4.egg to \/Volumes\/UserHome\/Users\/csev\/Library\/Python\/2.4\/site-packages<br \/>\nAdding networkx 0.35.1 to easy-install.pth file<br \/>\nInstalled \/Volumes\/UserHome\/Users\/csev\/Library\/Python\/2.4\/site-packages\/networkx-0.35.1-py2.4.egg<br \/>\nProcessing dependencies for networkx<br \/>\nFinished processing dependencies for networkx<br \/>\neasy_install pyGTK &#8212; did not work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-375","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/375","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/comments?post=375"}],"version-history":[{"count":1,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/375\/revisions"}],"predecessor-version":[{"id":2472,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/375\/revisions\/2472"}],"wp:attachment":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/media?parent=375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/categories?post=375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/tags?post=375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}