Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8134429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:01:29+00:00 2026-06-06T10:01:29+00:00

I am completely new to Python and wanted to use py2neo and tornado module.

  • 0

I am completely new to Python and wanted to use py2neo and tornado module.

In order to do that I ran setup.py for both modules and placed them into folders

C:\Python32\modules\py2neo

and

C:\Python32\modules\tornado

In the main program I guess these lines tell the interpreter where to look for files:

import sys
sys.path.append(r'C:\Python32\modules')



# Import Neo4j modules
from py2neo import neo4j, cypher

Reading the book I also added environmental variable (in Windows 7)

PYTHONPATH = C:\Python32\modules;C:\Python32\modules\tornado;C:\Python32\modules\py2neo

Edit

Now I figured out that Python Shell has to be restarted in order to load modified PYTHONPATH variable
In case the variable value is PYTHONPATH = C:\Python32\modules
and the program contains the line

from py2neo import neo4j, cypher

then the following lines are useless:

import sys
sys.path.append(r'C:\Python32\modules')

When I run the program however I get the following error:

Traceback (most recent call last):
  File "C:\...\Python Projects\HelloPython\HelloPython\Hellopy2neo.py", line 15, in <module>
    from py2neo import neo4j, cypher
  File "C:\Python32\modules\py2neo\neo4j.py", line 38, in <module>
    import rest, batch, cypher
ImportError: No module named rest

In the file neo4j.py there are the following lines:

try:
    import json
except ImportError:
    import simplejson as json
try:
    from urllib.parse import quote
except ImportError:
    from urllib import quote
try:
    from . import rest, batch, cypher
except ImportError:
    import rest, batch, cypher #line38

and rest.py file is located in folder C:\Python32\modules\py2neo so I don’t know why I get the error

ImportError: No module named rest

Edit2:

Trying to import the py2neo directoy in Python Shell and list modules I get:

>>> import py2neo
>>> [name for name in dir(py2neo) if name[0] != '_']
['rest']

I guess there are some unneccesary imports as well and would be very thankful if anyone explained, which imports should be added and excluded (in PYTHONPATH and scripts) in order the program to run without errors.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:01:32+00:00Added an answer on June 6, 2026 at 10:01 am

    I suspect the problem is that the import syntax for relative imports has changed in transition from Python 2 to Python 3:

    The only acceptable syntax for relative imports is from .[module]
    import name. All import forms not starting with . are interpreted as
    absolute imports.

    The modules you installed use the syntax that would work in Python 2. You could either install them for Python 2, or look for a version of py2neo that supports Python 3, or try to port it manually (the import line should look like from . import rest, but you’ll probably face other problems later) or with 2to3 tool.

    Update: I tried installing py2neo with pip. It failed for Python3 and finished successfully for Python 2. The version is 1.2.14.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am completely new to python but I found a package that I need
Apologies for the noobish question, I am completely new to both Python and Django
Okay, I'm completely new to this. I created a python script that imports tkinter
I'm completely new to Python, and now I've to change a script so it
Does python create a completely new string (copying the contents) when you do a
Disclaimer: completely new to Python from a PHP background Ok I'm using Python on
I'm new to Python completely and am using Python 3.1 on Windows (pywin). I
I'm completely new to python (and it's been a while since I've coded much).
I'm completely new to Python and while trying various random bits and pieces I've
I am fairly new to Python programming, and completely new to cross-platform GUI building

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.