Open brunoripa opened 8 years ago
File "/neoflask/neoflask/app.py", line 3, in <module>
from neoflask.extensions import (
File "/neoflask/neoflask/extensions.py", line 1, in <module>
from flask_neo4j import Neo4j
File "/usr/local/lib/python2.7/site-packages/flask_neo4j.py", line 7, in <module>
from py2neo.ext import ogm
ImportError: cannot import name ogm
requirements.txt:
Flask==0.11.1 py2neo==3.1.2 Flask-Neo4j==0.5.1
Any plans for compatibility?
@lashex I think the issue above might be solved by updating pypi. This was not present: https://github.com/lashex/flask-neo4j/commit/16d4628e4456a652869d4331b428f3e150a9b0d7
Sorry for my lag. I accepted the pull request that seems to have fixed this. @brunoripa can you confirm the issue has resolved for you?
Sorry for the huge delay.
Still occurs for me. Environment:
Flask==0.11.1
Flask-Neo4j==0.5.1
py2neo==3.1.2
Example code is the same of the README.
Have the same import error
python dracula.py
dracula.py:2: ExtDeprecationWarning: Importing flask.ext.neo4j is deprecated, use flask_neo4j instead.
from flask.ext.neo4j import Neo4j
Traceback (most recent call last):
File "dracula.py", line 2, in
Also i went to the site you provided "https://github.com/lashex/flask-neo4j/commit/16d4628e4456a652869d4331b428f3e150a9b0d7" my code node is from flask import Flask from flask.ext.neo4j import Neo4j from py2neo import Node,Relationship
GRAPH_DATABASE='http://neo4j:123@localhost:7474'
import time import logging from py2neo import authenticate, Graph,Node
try: from py2neo import ogm except ImportError: from py2neo.ext import ogm
log = logging.getLogger('flask.neo4j') logging.basicConfig()
from py2neo.packages.httpstream.http import SocketError
try: from py2neo import ogm except ImportError: from py2neo.ext import ogm
log = logging.getLogger('flask.neo4j') logging.basicConfig()
app = Flask(name) app.config.from_object(name) graph_indexes = {'Species': Node} flask4j = Neo4j(app, graph_indexes).gdb print flask4j.neo4j_version nosferatu = Node('species',full_name='Dracula nosferatu',species_name='nosferatu') genus = Node('genus',name='Dracula') nosferatu_memberof_genus = Relationship(nosferatu,'Member-of',genus) flask4j.create(nosferatu_memberof_genus)
-->and still not working... any idea?
Instead of 'pip install flask-neo4j' you should install directly from Github. Seems like the current package on PyPi is old.
This worked for me:
pip uninstall flask-neo4j pip install -e git+https://github.com/lashex/flask-neo4j.git#egg=flask-neo4j
Also, this:
from flask import Flask from flask.ext.neo4j import Neo4j from py2neo import Node,Relationship
Should now be this:
from flask import Flask from flask_neo4j import Neo4j from py2neo import Node,Relationship
Apparently the
README.rst
example does not work ifpy2neo
version is >= 2.0.9. Maybe version should be pinned insetup.py
?It fails by:
Issue disappears if i downgrade
py2neo
at 2.0.9 by doing: