อย่างแรก คือตอนนี้ผมใช้ ubuntu 10.04 แต่ต้องใช้ neo4j เพราะว่าใช้ใน thesis
เลยจะลงตัว neo4j-python ซึ่งเป็นตัว binding
ตัว neo4j เป็น graph database ตัวหนึ่งที่ opensource ให้ใช้ฟรี แบบ GFPL
ซึ่งอาจจะเรียกว่า เป็น nosql ตัวหนึ่ง ความพิเศษตรงที่มัน bindng python นี่ล่ะครับ
เพราะผมต้องการใช้ร่วมกับ django แถมมันมีตัวอย่าง app ที่สร้าง model ให้ โดยไม่ต้องแก้อะไรมาก
เปลี่ยนตรง model แทน เอาไว้พอคล่องเดี๋ยวคงมาเขียนบล็อก
เริ่มต้นเลย คือ เนื่องจากมันเป็น java ที่ binding มาครับ เลยต้องใช้ตัว binnding ทีแรกลง jython
แต่ใน ubuntu ลงไม่ได้ เพราะเป็นรุ่นเก่า 2.2 เลยต้องดึงมาจาก debian sid แทน
พอลงปุ้บ ก็เจอปัญหาเลย
-
sake@sake-laptop:~/project/Thesis/tools$ svn export https://svn.neo4j.org/components/neo4j.py/trunk neo4j-python
-
sake@sake-laptop:~/project/Thesis/tools/neo4j-python$ cd neo4j-python
-
sake@sake-laptop:~/project/Thesis/tools/neo4j-python$ sudo jython setup.py install
-
setup.py:54: UserWarning: Setuptools is not available.
-
You will need to make sure that you either have JCC installed prior to
-
installing Neo4j.py, or that you have JPype installed alongside with
-
Neo4j.py. With setuptools these could have been automatically installed.
-
-
warnings.warn("""Setuptools is not available.
-
Traceback (most recent call last):
-
File "setup.py", line 146, in <module>
-
main()
-
File "setup.py", line 134, in main
-
args[attr] = pom[attr]
-
File "/home/sake/project/Thesis/tools/neo4j-python/pom.py", line 59, in __getitem__
-
return self.pattern.sub(lambda match:self[match.groupdict()['var']],
-
File "/home/sake/project/Thesis/tools/neo4j-python/pom.py", line 59, in <lambda>
-
return self.pattern.sub(lambda match:self[match.groupdict()['var']],
-
File "/home/sake/project/Thesis/tools/neo4j-python/pom.py", line 54, in __getitem__
-
element = self.parent[path]
-
File "/home/sake/project/Thesis/tools/neo4j-python/pom.py", line 93, in __getitem__
-
return replacement.get(path, lambda s,x:x)(self, self.__pom[path])
-
File "/home/sake/project/Thesis/tools/neo4j-python/pom.py", line 58, in __getitem__
-
raise KeyError(path)
-
KeyError: 'project.artifactId'
-
sake@sake-laptop:~/project/Thesis/tools/neo4j-python$
หลังจากงมอยู่นาน ก็พบว่าต้องไปแก้ในไฟล์ pom.py ดังนี้ครับ
-
if element is None and self.parent is not None:
-
element = self.parent[path]
-
if element is None: # added
-
element = self.tree.findtext(self.__path('dependencies')) # added
-
if element is None:
-
raise KeyError(path)
-
return self.pattern.sub(lambda match:self[match.groupdict()['var']],
-
element)
จากนั้น ก็ลงได้แล้ว
-
sake@sake-laptop:~/project/Thesis/tools/neo4j-python$ sudo jython setup.py install
-
setup.py:54: UserWarning: Setuptools is not available.
-
You will need to make sure that you either have JCC installed prior to
-
installing Neo4j.py, or that you have JPype installed alongside with
-
Neo4j.py. With setuptools these could have been automatically installed.
-
-
warnings.warn("""Setuptools is not available.
-
running install
-
running build
-
running build_py
-
package init file 'dependencies/__init__.py' not found (or not a regular file)
-
copying dependencies/geronimo-jta_1.1_spec.jar -> build/lib/neo4j/classes
-
copying dependencies/junit.jar -> build/lib/neo4j/classes
-
package init file 'dependencies/__init__.py' not found (or not a regular file)
-
running install_lib
-
creating /usr/share/jython/Lib/site-packages/neo4j
-
copying build/lib/neo4j/_index.py -> /usr/share/jython/Lib/site-packages/neo4j
-
creating /usr/share/jython/Lib/site-packages/neo4j/_backend
-
copying build/lib/neo4j/_backend/reflection.py -> /usr/share/jython/Lib/site-packages/neo4j/_backend
-
copying build/lib/neo4j/_backend/jcc.py -> /usr/share/jython/Lib/site-packages/neo4j/_backend
-
copying build/lib/neo4j/_backend/cli.py -> /usr/share/jython/Lib/site-packages/neo4j/_backend
-
copying build/lib/neo4j/_backend/__init__.py -> /usr/share/jython/Lib/site-packages/neo4j/_backend
-
copying build/lib/neo4j/_backend/pure.py -> /usr/share/jython/Lib/site-packages/neo4j/_backend
-
copying build/lib/neo4j/_backend/native.py -> /usr/share/jython/Lib/site-packages/neo4j/_backend
-
copying build/lib/neo4j/tracsupport.py -> /usr/share/jython/Lib/site-packages/neo4j
-
copying build/lib/neo4j/__bootstrap__.py -> /usr/share/jython/Lib/site-packages/neo4j
-
copying build/lib/neo4j/_util.py -> /usr/share/jython/Lib/site-packages/neo4j
-
creating /usr/share/jython/Lib/site-packages/neo4j/model
-
copying build/lib/neo4j/model/__init__.py -> /usr/share/jython/Lib/site-packages/neo4j/model
-
copying build/lib/neo4j/_py_compat.py -> /usr/share/jython/Lib/site-packages/neo4j
-
creating /usr/share/jython/Lib/site-packages/neo4j/_hooks
-
copying build/lib/neo4j/_hooks/__init__.py -> /usr/share/jython/Lib/site-packages/neo4j/_hooks
-
copying build/lib/neo4j/util.py -> /usr/share/jython/Lib/site-packages/neo4j
-
copying build/lib/neo4j/_traverse.py -> /usr/share/jython/Lib/site-packages/neo4j
-
copying build/lib/neo4j/__init__.py -> /usr/share/jython/Lib/site-packages/neo4j
-
copying build/lib/neo4j/_core.py -> /usr/share/jython/Lib/site-packages/neo4j
-
creating /usr/share/jython/Lib/site-packages/neo4j/classes
-
copying build/lib/neo4j/classes/neo4j-kernel.jar -> /usr/share/jython/Lib/site-packages/neo4j/classes
-
copying build/lib/neo4j/classes/junit.jar -> /usr/share/jython/Lib/site-packages/neo4j/classes
-
copying build/lib/neo4j/classes/neo4j-index.jar -> /usr/share/jython/Lib/site-packages/neo4j/classes
-
copying build/lib/neo4j/classes/neo4j-commons.jar -> /usr/share/jython/Lib/site-packages/neo4j/classes
-
copying build/lib/neo4j/classes/lucene-core.jar -> /usr/share/jython/Lib/site-packages/neo4j/classes
-
copying build/lib/neo4j/classes/geronimo-jta_1.1_spec.jar -> /usr/share/jython/Lib/site-packages/neo4j/classes
-
copying build/lib/neo4j/classes/neo4j-remote-graphdb.jar -> /usr/share/jython/Lib/site-packages/neo4j/classes
-
copying build/lib/neo4j/_base.py -> /usr/share/jython/Lib/site-packages/neo4j
-
copying build/lib/neo4j/_primitives.py -> /usr/share/jython/Lib/site-packages/neo4j
-
copying build/lib/neo4j/_compat.py -> /usr/share/jython/Lib/site-packages/neo4j
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/_index.py to _index$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/_backend/reflection.py to reflection$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/_backend/jcc.py to jcc$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/_backend/cli.py to cli$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/_backend/__init__.py to __init__$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/_backend/pure.py to pure$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/_backend/native.py to native$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/tracsupport.py to tracsupport$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/__bootstrap__.py to __bootstrap__$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/_util.py to _util$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/model/__init__.py to __init__$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/_py_compat.py to _py_compat$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/_hooks/__init__.py to __init__$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/util.py to util$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/_traverse.py to _traverse$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/__init__.py to __init__$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/_core.py to _core$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/_base.py to _base$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/_primitives.py to _primitives$py.class
-
byte-compiling /usr/share/jython/Lib/site-packages/neo4j/_compat.py to _compat$py.class
-
running install_egg_info
-
Writing /usr/share/jython/Lib/site-packages/Neo4j.py-0.1_SNAPSHOT-py2.5.egg-info
-
sake@sake-laptop:~/project/Thesis/tools/neo4j-python$
เย้ ๆ ใช้ได้แล้ว ^^
เพิ่มเติม:
http://components.neo4j.org/neo4j.py/
ไฟล์แนบ | ขนาด |
---|---|
pom.py.txt | 6.38 KB |