1

I have built a small python application in Django framework, with Neo4j database hosted on Graphene db. I am integrating Travis-CI for continuous integration with the application on github, however, I am stuck on getting an error in Travis like: ImportError: No module named 'neo4j' Below is my .travis.yml file:

language: python
python:
 - "3.4"
 - "2.7"
# command to install dependencies
install:
 - pip install -q Django==$DJANGO_VERSION
 - pip install py2neo
 - pip install neo4django
 - pip install -r requirements.txt
# command to run tests
script: python eb_django_app/neo4j/manage.py test
env:
 - DJANGO_VERSION=1.8.3
branches:
 only:
  - master

manage.py :

import os
import sys
from py2neo import neo4j
from py2neo import ServiceRoot
graphenedb_url = os.environ.get("graphene db url", "http://localhost:7474/")
graph = ServiceRoot(graphenedb_url).graph
if __name__ == "__main__":
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "neo4j.settings")
  from django.core.management import execute_from_command_line
  execute_from_command_line(sys.argv)

The folder structure of python application is:

eb_django_app
    |_ .travis.yml
    |_ requirements.txt
    |_ eb_django_app
       |_python codebase
       |_manage.py
       |_neo4j
           |_manage.py
           |_tests.py

I am new to both Travis and Python. Am i missing something? Can someone please help me out with a solution to resolve this error, would really appreciate some immediate response?

ekta
  • 121
  • 1
  • 5

0 Answers0