python etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
python etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

28 Nisan 2013 Pazar

19 Nisan 2013 Cuma

a python book - part 1

Nowadays, i am trying to learn Python and prepared a repository consisting of Python books, tutors etc..
Actually, finding good documentation on Python isn't that hard due to its widespread use..
Anyway, i am using the online free book on ww.rexx.com/~dkuhlman/ and take my own notes during study..
In this post, i publish those notes of mine as notebook pages, a weird way for sharing actually!!
The book consists of three parts, and (i can say that) this is the summary of first part.. 














 

16 Ocak 2012 Pazartesi

pygraphviz on windows (Python 2.7)

Installing pygraphviz on Windows is a lit bit tricky.. It took almost all my sunday afternoon to find out a solution that works for me.. Finally i did by following instructions on http://blog.ropardo.ro/2011/11/28/installing-pygraphviz-on-windows/ 


Here is my steps:
  1. Install ActivePython Community Edition (http://www.activestate.com/activepython) in order to have easy_install. Add PYTHON_HOME/Scripts folder to PATH variable.
  2. Install required/wanted Python packages with easy_install. However, pygraphviz do not have a Windows build, and it can not be easy installed, since Python does not know where Graphviz is installed..
  3. Install Graphviz (http://www.graphviz.org/
  4. Installed an old version of MinGW (specifically the build on 20100831) (http://www.mingw.org/) . Add MinGW/bin to PATH.
  5. Download pygraphviz (http://networkx.lanl.gov/pygraphviz/) and extract it.
    1. Edit setup.py of pygraphviz as follows:     (they are None as default..)
      • library_path="C:/Graphviz 2.28/lib/release/lib"
      • include_path="C:/Graphviz 2.28/include/graphviz" 
    2. Modify line 285 (most probably) from “C:\python27\lib\distutils\unixcompiler.py" as follows:
      • old:  compiler = os.path.basename(sysconfig.get_config_var("CC"))
      • new: compiler =  "gcc" 
    3. Run the following command from pygraphviz-$version folder:
      • python setup.py build -c mingw32
    4. Copy the pygraphviz folder under (some place like) C:\pygraphviz-1.1\build\lib.win32-2.7 to Python site-packages.My site-packages location is  C:\Python27\Lib\site-packages.
After the steps above, import pygraphviz should succeed on Python interpreter..

The link which i presented in the beginning of this post worked for me.. However, some slightly different solutions exist (unfortunately, they did not help much my condition):