I'm trying to setup an instance of FeinCMS to check it out. I've added the all the modules under INSTALLED APPS
but when I run the command python manage.py syncdb
I get the error Import Error: No module named mptt
. What am I doing wrong?
My settings.py:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'feincms',
'mptt',
'feincms.module.page',
'feincms.module.medialibrary'
)
Did you install the package?
> pip install django-mptt
I assume you're using a virtualenv?
Is your project running within the same Python env as the interpreter? If it is, a quick check would be:
> pip install yolk
> yolk -l # see if the mptt package is available, if not:
> pip install django-mptt # optionally use the --update flag
Still issues? Remove any *.pyc
files and restart your server to make sure there's no import issues from previously removed files.
> find . -type f -name "*.pyc" | xargs rm
> ./manage.py runserver 8000
No good? Add a statement to your manage.py file right after your import statements:
# ...
import sys
print sys.path
Re-run the server to see if the mptt is missing from your path, if it is, check your site-packages folder and check the package's path.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.