I'm trying to run the following package from github - https://github.com/rollstudio/django-admin2-sb
But I'm getting the following traceback
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute
django.setup()
File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 21, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 87, in create
module = import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/djadmin2/__init__.py", line 13, in <module>
from . import core
File "/usr/local/lib/python2.7/dist-packages/djadmin2/core.py", line 14, in <module>
from . import apiviews
File "/usr/local/lib/python2.7/dist-packages/djadmin2/apiviews.py", line 12, in <module>
from .viewmixins import Admin2Mixin
File "/usr/local/lib/python2.7/dist-packages/djadmin2/viewmixins.py", line 15, in <module>
from braces.views import AccessMixin
ImportError: cannot import name AccessMixin
braces is installed I can see it in the following location -
/usr/local/lib/python2.7/dist-packages/braces/views
_access.py contains the class class AccessMixin(object):
so why doesn't it import?
In django-braces 1.3, views exported AccessMixin but in django-braces 1.4 this was moved to views._access and not exported in views.
This should be fixed in versions>1.4
Another workaround for this error is to downgrade django-braces to version 1.3.1.
Checkout this github issue: https://github.com/pydanny/django-admin2/issues/396
Related
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/devbase/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/home/devbase/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute
django.setup()
File "/home/devbase/env/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/devbase/env/local/lib/python2.7/site-packages/django/apps/registry .py", line 85, in populate
app_config = AppConfig.create(entry)
File "/home/devbase/env/local/lib/python2.7/site-packages/django/apps/config.p y", line 94, in create
module = import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/devbase/env/local/lib/python2.7/site-packages/djorm_pgtrgm/__init_ _.py", line 1, in <module>
from django.db import backend
ImportError: cannot import name backend
It looks like you are using djorm_pgtrgm. It hasn't been updated for two years, so you can't expect it to work with recent versions of Django.
This merged pull request suggests that the import error has been fixed in the GitHub repo, but there hasn't been a release since then. You could try installing from source, but you should think about whether you want to use an unmaintained package in your project.
I am following an installation in lfs to insert a check out page in my website. I have copies all the instruction but after I tried to mia it produces an error.
(my_project) PS C:\my_project\src> python manage.py migrate
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "C:\my_project\lib\site-
packages\django\core\management\__init__.py", line 367, in
execute_from_command_line
utility.execute()
File "C:\my_project\lib\site-
packages\django\core\management\__init__.py", line 341, in execute
django.setup()
File "C:\my_project\lib\site-packages\django\__init__.py", line 27, in
setup
apps.populate(settings.INSTALLED_APPS)
File "C:\my_project\lib\site-packages\django\apps\registry.py", line 85,
in populate
app_config = AppConfig.create(entry)
File "C:\my_project\lib\site-packages\django\apps\config.py", line 90, in
create
module = import_module(entry)
File "c:\python27\Lib\importlib\__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named lfs_theme
(my_project) PS C:\my_project\src>
Traceback:
Traceback (most recent call last):
File "my_script.py", line 16, in <module>
django.setup()
File "c:\Python27\lib\site-packages\django\__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "c:\Python27\lib\site-packages\django\apps\registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "c:\Python27\lib\site-packages\django\apps\config.py", line 112, in create
mod = import_module(mod_path)
File "c:\Python27\lib\importlib\__init__.py", line 37, in import_module
__import__(name)
File "c:\Python27\lib\site-packages\django\contrib\contenttypes\apps.py", line 7, in
<module>
from .management import update_contenttypes
ImportError: cannot import name update_contenttypes
The script used to run fine until I attempted to update django-allauth (which updated a ton of other packages: pytz, requests, oauthlib, requests-oauthlib, and Django (though I Ctrl-C'd when it started wanting to update Django. I am using Django 1.8.5)
Traceback (most recent call last):
File "manage.py", line 10, in <module> execute_from_command_line(sys.argv)
File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
utility.execute()
File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 324, in execute
django.setup()
File "/Library/Python/2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Library/Python/2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/Library/Python/2.7/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Library/Python/2.7/site-packages/social/__init__.py", line 5, in <module>
from .fsong import *
File "/Library/Python/2.7/site-packages/social/fsong.py", line 1, in <module>
import gmane as g, networkx as x, pylab as p, numpy as n, os
File "/Library/Python/2.7/site-packages/gmane/__init__.py", line 26, in <module>
from .networkEvolution import NetworkEvolution
File "/Library/Python/2.7/site-packages/gmane/networkEvolution.py", line 9, in <module>
from .pca import *
File "/Library/Python/2.7/site-packages/gmane/pca.py", line 79
def __init__(self,*metrics,final_dimensions=2,draw=False):
SyntaxError: invalid syntax
I have installed django using pip and trying to run python manage.py migrate. I am facing the above error. Any one have faced this before? I am using OSX and python version is 2.7.10, Django version 1.9
I'm having troubles when I try to create my project on Django.
Error message:
django-admin.py startproject car
Traceback (most recent call last):
File "/usr/local/bin/django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 77, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/startproject.py", line 2, in <module>
from django.core.management.templates import TemplateCommand
File "/usr/local/lib/python2.7/site-packages/django/core/management/templates.py", line 20, in <module>
from django.template import Template, Context
File "/usr/local/lib/python2.7/site-packages/django/template/__init__.py", line 53, in <module>
from django.template.base import (ALLOWED_VARIABLE_CHARS, BLOCK_TAG_END,
File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 12, in <module>
from django.utils.text import (smart_split, unescape_string_literal,
File "/usr/local/lib/python2.7/site-packages/django/utils/text.py", line 6, in <module>
from gzip import GzipFile
File "/usr/local/lib/python2.7/gzip.py", line 9, in <module>
import zlib
ImportError: No module named zlib
(I already have Python 2.7 and Django 1.5.1 installed)
You should read your errors more carefuly.
ImportError: No module named zlib