Pages

Google Ads

Saturday, June 13, 2015

How to install python-louvain 0.3 (Louvain algorithm for community detection) on Mac OS

Install community library:

Louvain algorithm for community detection

1) download from: https://pypi.python.org/pypi/python-louvain/0.3

2) Unzip python-louvain-0.3.tar.gz

3) Run on terminal the command sudo python setup.py install in side the unzip folder called python-louvain-0.3

4) Restart ipython notebook

5) Try it.


Last login: Sat Jun 13 10:25:49 on ttys000
Caios-MacBook-Pro:u-tad caiomsouza$ sudo python setup.py install
Password:
python: can't open file 'setup.py': [Errno 2] No such file or directory
Caios-MacBook-Pro:u-tad caiomsouza$ ls
Mod1            Mod15            Mod5            contributors.txt
Mod10            Mod16            Mod6            material-internet
Mod11            Mod17            Mod7            planning_EDS_2ED.pdf
Mod12            Mod2            Mod8
Mod13            Mod3            Mod9
Mod14            Mod4            actividades-utad.xlsx
Caios-MacBook-Pro:u-tad caiomsouza$ cd Mod9/
Caios-MacBook-Pro:Mod9 caiomsouza$ ls
GD_M09_Grafos_SNA.pdf    datasets        python-lib        slides
Caios-MacBook-Pro:Mod9 caiomsouza$ cd python-lib/
Caios-MacBook-Pro:python-lib caiomsouza$ ls
python-louvain-0.3.tar.gz
Caios-MacBook-Pro:python-lib caiomsouza$ ls
python-louvain-0.3        python-louvain-0.3.tar.gz
Caios-MacBook-Pro:python-lib caiomsouza$ cd python-louvain-0.3
Caios-MacBook-Pro:python-louvain-0.3 caiomsouza$ ls
PKG-INFO        community        setup.cfg
README            python_louvain.egg-info    setup.py
Caios-MacBook-Pro:python-louvain-0.3 caiomsouza$ sudo python setup.py install


Output:

Caios-MacBook-Pro:python-louvain-0.3 caiomsouza$ sudo python setup.py install
running install
/Users/caiomsouza/anaconda/lib/python2.7/site-packages/setuptools-14.3-py2.7.egg/pkg_resources/__init__.py:2512: PEP440Warning: 'llvmlite (0.2.2-1-gbcb15be)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
running bdist_egg
running egg_info
writing requirements to python_louvain.egg-info/requires.txt
writing python_louvain.egg-info/PKG-INFO
writing top-level names to python_louvain.egg-info/top_level.txt
writing dependency_links to python_louvain.egg-info/dependency_links.txt
writing entry points to python_louvain.egg-info/entry_points.txt
reading manifest file 'python_louvain.egg-info/SOURCES.txt'
writing manifest file 'python_louvain.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.5-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/community
copying community/__init__.py -> build/lib/community
creating build/bdist.macosx-10.5-x86_64
creating build/bdist.macosx-10.5-x86_64/egg
creating build/bdist.macosx-10.5-x86_64/egg/community
copying build/lib/community/__init__.py -> build/bdist.macosx-10.5-x86_64/egg/community
byte-compiling build/bdist.macosx-10.5-x86_64/egg/community/__init__.py to __init__.pyc
creating build/bdist.macosx-10.5-x86_64/egg/EGG-INFO
copying python_louvain.egg-info/PKG-INFO -> build/bdist.macosx-10.5-x86_64/egg/EGG-INFO
copying python_louvain.egg-info/SOURCES.txt -> build/bdist.macosx-10.5-x86_64/egg/EGG-INFO
copying python_louvain.egg-info/dependency_links.txt -> build/bdist.macosx-10.5-x86_64/egg/EGG-INFO
copying python_louvain.egg-info/entry_points.txt -> build/bdist.macosx-10.5-x86_64/egg/EGG-INFO
copying python_louvain.egg-info/requires.txt -> build/bdist.macosx-10.5-x86_64/egg/EGG-INFO
copying python_louvain.egg-info/top_level.txt -> build/bdist.macosx-10.5-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/python_louvain-0.3-py2.7.egg' and adding 'build/bdist.macosx-10.5-x86_64/egg' to it
removing 'build/bdist.macosx-10.5-x86_64/egg' (and everything under it)
Processing python_louvain-0.3-py2.7.egg
Copying python_louvain-0.3-py2.7.egg to /Users/caiomsouza/anaconda/lib/python2.7/site-packages
Adding python-louvain 0.3 to easy-install.pth file
Installing community script to /Users/caiomsouza/anaconda/bin

Installed /Users/caiomsouza/anaconda/lib/python2.7/site-packages/python_louvain-0.3-py2.7.egg
Processing dependencies for python-louvain==0.3
Searching for networkx==1.9.1
Best match: networkx 1.9.1
Adding networkx 1.9.1 to easy-install.pth file

Using /Users/caiomsouza/anaconda/lib/python2.7/site-packages
Finished processing dependencies for python-louvain==0.3

Note for Linux Ubuntu Users:
If you are using Linux Ubuntu you will maybe need to install setuptools.

export PATH=/opt/anaconda/bin/:$PATH;
ipython notebook

No comments: