Showing posts with label py2neo. Show all posts
Showing posts with label py2neo. Show all posts

Wednesday, October 28, 2015

Neo4j installation

Install Neo4j(graph DB) on ubuntu 14.04.03


1. First install java7
$ sudo apt-get update
$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java7-installer

2. Download Neo4j(select community edition)
http://neo4j.com/download/

3. Extract file, refer to the top-level extracted directory as : NEO4J_HOME

4. Open ~/.bashrc and change
export PATH=$PATH:\
/home/...../neo4j-community-2.3.0

5. Run
$ sudo ./bin/neo4j start or stop or restart

6. Open web browser and type in "localhost:7474"



*****
If you want to use Neo4j in Python project, you need to python module like py2neo

1. Install py2neo
$ sudo pip install py2neo

2. Setting port / user name / password when you make code
from py2neo import neo4j, authenticate, Graph

host_port = "localhost:7474"
user_name = "neo4j"
password = "neo4j"

authenticate(host_port, user_name, password)
graph = Graph("http://localhost:7474/db/data/")



Ref:
http://www.delimited.io/blog/2014/1/15/getting-started-with-neo4j-on-ubuntu-server
http://neo4j.com/docs/stable/server-installation.html
http://py2neo.org/2.0/