1

I'm just starting out with django trying to use an external app. I've downloaded the app and installed it:

sudo setup.py install
...
Adding django-nested-inlines 0.1 to easy-install.pth file

Installed /Applications/djangostack-1.4.7-0/python/lib/python2.7/site-packages/django_nested_inlines-0.1-py2.7.egg

I also followed the app tutorial and included the app in the settings file:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    #'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
     'nested_inlines',
     'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
    'polls',
) 

But when I try to run the server again I get:

bash-3.2$ python manage.py runserver
Error: No module named nested-inlines

What's wrong here?

EDIT:

I didn't install using pip rather downloaded it. django is installed using Bitnami under Mac OS.

Tom
  • 9,275
  • 25
  • 89
  • 147

2 Answers2

2

This is a guess, but that app is probably not available on your PYTHONPATH. You may need to tell Django to look in there to find applications you want to use. Something like the following might work to make it so that your settings.py can import the app for your django project.

settings.py

import sys
sys.path.append("/Applications/djangostack-1.4.7-0/python/lib/python2.7/site-packages/")

## After which you can include it in your installed apps:

INSTALLED_APPS = (
'nested_inlines',
'other apps',
'etc',
)
erewok
  • 7,555
  • 3
  • 33
  • 45
  • No problem. Let me take the time to recommend (as someone did for me awhile back) that you consider using virtualenv. It solves a lot of these problems. If you keep installing stuff from source, at some point, you may end up with a screwy environment and conflicting packages and versions. In short, Virtualenv can prevent a lot of headaches. – erewok Sep 15 '13 at 21:12
  • Third time that I'm hearing about virualenv. I will definitely take a look – Tom Sep 15 '13 at 21:15
  • Yeah, it's a bit of a cliche (truism). It took me awhile to listen but I am really glad that I finally did. – erewok Sep 15 '13 at 21:19
  • @erewok I'm using a virtualenv and I'm trying to figure out this very same problem. – Malik Brahimi Aug 31 '17 at 14:39
0

try this using pip, I got a similar error

pip install django-nested-inline

This worked for me. I am using pip version 9.0.1. And python version 2.7.x

Raghu I
  • 45
  • 7