Giter Club home page Giter Club logo

movies-python-py2neo-2.0's Introduction

Neo4j Movies Example Application - The Python Version

First get yourself setup with Virtual Env so we don’t break any other Python stuff you have on your machine. After you’ve got that installed let’s setup an environment for our app:

$ virtualenv cypher-app
New python executable in cypher-app/bin/python
Installing setuptools, pip...done.
$ source cypher-app/bin/activate

The next step is to install the dependencies for the app:

(cypher-app)$ pip install -r requirements.txt
...
Successfully installed py2neo
Cleaning up...

And finally let’s start up a Bottle web server:

(cypher-app)$ python example.py
Bottle v0.12.7 server starting up (using WSGIRefServer())...
Listening on http://127.0.0.1:8080/
Hit Ctrl-C to quit.

Navigate to http://localhost:8080 and you should see your first Neo4j application

movies-python-py2neo-2.0's People

Contributors

jexp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

movies-python-py2neo-2.0's Issues

couldn't install py2neo

after creating a virtualenv (cypher-app), when I run "pip install requirements.txt", it shows error,
" Could not find a version that satisfies the requirement requirements.txt (from versions: )
No matching distribution found for requirements.txt "
I tried using pip install py2neo and that gave me a result
"Requirement already satisfied (use --upgrade to upgrade): py2neo in /usr/local/lib/python2.7/dist-packages"
I even tried changing the requirements.txt to py2neo(instead of py2neo==2.0) but that didn't work and I was given the previous error

KeyError upon start (due to wrong URL)

When starting the server with python example.py

I get the following error:


127.0.0.1 - - [30/Apr/2020 13:41:28] "GET / HTTP/1.1" 304 0
Traceback (most recent call last):
  File "/Users/frank/src/3rd_party/movies-python-py2neo-2.0/bottle.py", line 862, in _handle
    return route.call(**args)
  File "/Users/frank/src/3rd_party/movies-python-py2neo-2.0/bottle.py", line 1729, in wrapper
    rv = callback(*a, **ka)
  File "example.py", line 22, in get_graph
    results = graph.cypher.execute(
  File "/Users/frank/src/3rd_party/movies-python-py2neo-2.0/cypher-app/lib/python3.7/site-packages/py2neo/core.py", line 590, in cypher
    self.__cypher = CypherResource(metadata["cypher"], metadata.get("transaction"))
KeyError: 'cypher'

Apparently this is caused by a wrong URL in example.py (missing /db/data suffix, as mentioned in https://stackoverflow.com/a/28222269/610979)

Changing

graph = Graph("http://username:<password>@localhost:7474")

to

graph = Graph("http://localhost:7474/db/data")

fixed the problem for me (I'm using a dockerized Neo4J that doesn't require logging in).

Couldn't run the basic "Matrix" query in the search bar on http://127.0.0.1:8080/

The steps I followed:

1/ I've follwed the setup instructions:

  • created a virtualenv
    • activated the virtualenv
    • installed the required dependencies

      2/ I've cloned movies-python-py2neo-2.0 on my Mac using the git clone command

      3/ I've run "python example.py

At that moment, I can access the index.html at http://127.0.0.1:8080/ on my browsers (Firefox and Chrome).

However, when I searched "Matrix" in the top-left search bar, I receive an error message:

(cypher-app)➜ movies-python-py2neo-2.0 git:(master) ✗ python example.py
Bottle v0.12.7 server starting up (using WSGIRefServer())...
Listening on http://127.0.0.1:8080/
Hit Ctrl-C to quit.

127.0.0.1 - - [10/Aug/2015 11:27:28] "GET / HTTP/1.1" 200 6184
Traceback (most recent call last):
File "/Users/Thibault/test/myGraph/cypher-app/movies-python-py2neo-2.0/bottle.py", line 862, in _handle
return route.call(**args)
File "/Users/Thibault/test/myGraph/cypher-app/movies-python-py2neo-2.0/bottle.py", line 1729, in wrapper
rv = callback(_a, *_ka)
File "example.py", line 20, in get_graph
results = graph.cypher.execute(
File "/Users/Thibault/test/myGraph/cypher-app/lib/python2.7/site-packages/py2neo/core.py", line 589, in cypher
metadata = self.resource.metadata
File "/Users/Thibault/test/myGraph/cypher-app/lib/python2.7/site-packages/py2neo/core.py", line 198, in metadata
self.get()
File "/Users/Thibault/test/myGraph/cypher-app/lib/python2.7/site-packages/py2neo/core.py", line 241, in get
raise_from(self.error_class(message, **content), error)
File "/Users/Thibault/test/myGraph/cypher-app/lib/python2.7/site-packages/py2neo/util.py", line 215, in raise_from
raise exception
GraphError: HTTP GET returned response 401
127.0.0.1 - - [10/Aug/2015 11:27:29] "GET /graph HTTP/1.1" 500 746
Traceback (most recent call last):
File "/Users/Thibault/test/myGraph/cypher-app/movies-python-py2neo-2.0/bottle.py", line 862, in _handle
return route.call(**args)
File "/Users/Thibault/test/myGraph/cypher-app/movies-python-py2neo-2.0/bottle.py", line 1729, in wrapper
rv = callback(_a, *_ka)
File "example.py", line 50, in get_search
results = graph.cypher.execute(
File "/Users/Thibault/test/myGraph/cypher-app/lib/python2.7/site-packages/py2neo/core.py", line 589, in cypher
metadata = self.resource.metadata
File "/Users/Thibault/test/myGraph/cypher-app/lib/python2.7/site-packages/py2neo/core.py", line 198, in metadata
self.get()
File "/Users/Thibault/test/myGraph/cypher-app/lib/python2.7/site-packages/py2neo/core.py", line 241, in get
raise_from(self.error_class(message, **content), error)
File "/Users/Thibault/test/myGraph/cypher-app/lib/python2.7/site-packages/py2neo/util.py", line 215, in raise_from
raise exception
GraphError: HTTP GET returned response 401
127.0.0.1 - - [10/Aug/2015 11:27:29] "GET /search?q=Matrix HTTP/1.1" 500 756

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.