c:DemoBlogblog_system>manage.py syncdb
Traceback (most recent call last):
File "C:DemoBlogblog_systemmanage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:Python34libsite-packagesdjangocoremanagement__init__.py", line
399, in execute_from_command_line
utility.execute()
File "C:Python34libsite-packagesdjangocoremanagement__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:Python34libsite-packagesdjangocoremanagementbase.py", line 242,
in run_from_argv
self.execute(*args, **options.__dict__)
File "C:Python34libsite-packagesdjangocoremanagementbase.py", line 280,
in execute
translation.activate('en-us')
File "C:Python34libsite-packagesdjangoutilstranslation__init__.py", lin
e 130, in activate
return _trans.activate(language)
File "C:Python34libsite-packagesdjangoutilstranslationtrans_real.py", l
ine 188, in activate
_active.value = translation(language)
File "C:Python34libsite-packagesdjangoutilstranslationtrans_real.py", l
ine 177, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "C:Python34libsite-packagesdjangoutilstranslationtrans_real.py", l
ine 159, in _fetch
app = import_module(appname)
File "C:Python34libimportlib__init__.py", line 104, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
File "<frozen importlib._bootstrap>", line 2189, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1448, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "C:Python34libsite-packagesfile_picker__init__.py", line 4, in <modu
le>
from file_picker.views import FilePickerBase, ImagePickerBase
File "C:Python34libsite-packagesfile_pickerviews.py", line 73
except Exception, e:
^
SyntaxError: invalid syntax
我不知道是什么问题。但是当我清理settings。py
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'file_picker',
'file_picker.uploads',
'file_picker.wymeditor',
'bootstrap_toolkit',
'blog',
)
并拉下与文件选择器和引导连接的一切-它工作,请帮助我......................................................................................................................................................................................
我用except Exception as e
修复了它然后我再次尝试-它显示
c:DemoBlogblog_system>manage.py syncdb
C:Python34libimportlib_bootstrap.py:321: DeprecationWarning: django.utils.si
mplejson is deprecated; use json instead.
return f(*args, **kwds)
Traceback (most recent call last):
File "C:DemoBlogblog_systemmanage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:Python34libsite-packagesdjangocoremanagement__init__.py", line
399, in execute_from_command_line
utility.execute()
File "C:Python34libsite-packagesdjangocoremanagement__init__.py", line
392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:Python34libsite-packagesdjangocoremanagementbase.py", line 242,
in run_from_argv
self.execute(*args, **options.__dict__)
File "C:Python34libsite-packagesdjangocoremanagementbase.py", line 280,
in execute
translation.activate('en-us')
File "C:Python34libsite-packagesdjangoutilstranslation__init__.py", lin
e 130, in activate
return _trans.activate(language)
File "C:Python34libsite-packagesdjangoutilstranslationtrans_real.py", l
ine 188, in activate
_active.value = translation(language)
File "C:Python34libsite-packagesdjangoutilstranslationtrans_real.py", l
ine 177, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "C:Python34libsite-packagesdjangoutilstranslationtrans_real.py", l
ine 159, in _fetch
app = import_module(appname)
File "C:Python34libimportlib__init__.py", line 104, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
File "<frozen importlib._bootstrap>", line 2189, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1448, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "C:Python34libsite-packagesfile_picker__init__.py", line 4, in <modu
le>
from file_picker.views import FilePickerBase, ImagePickerBase
File "C:Python34libsite-packagesfile_pickerviews.py", line 17, in <module>
from sorl.thumbnail.main import DjangoThumbnail
File "C:Python34libsite-packagessorlthumbnailmain.py", line 4, in <module>
from django.utils.encoding import iri_to_uri, force_unicode
ImportError: cannot import name 'force_unicode'
......................................................................................................................................................................................在安装sorl- thumbnail之前,我必须安装一些要求,如redis, Pillow, pgmagick和Wand。
只有我不能安装pgmagick -这里是错误
C:Userswww>pip install pgmagick
Downloading/unpacking pgmagick
Downloading pgmagick-0.5.7.tar.gz
Running setup.py (path:C:TEMPpip_build_wwwpgmagicksetup.py) egg_info for p
ackage pgmagick
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "C:TEMPpip_build_wwwpgmagicksetup.py", line 74, in <module>
raise Exception("Magick++ not found")
Exception: Magick++ not found
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "C:TEMPpip_build_wwwpgmagicksetup.py", line 74, in <module>
raise Exception("Magick++ not found")
Exception: Magick++ not found
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in C:TEMPpip_build_w
wwpgmagick
Storing debug log for failure in C:Userswwwpippip.log
...........................................................................................................然后我安装了sorl-thumbnail,没有任何反应,又试了一次-
c:site>manage.py syncdb
C:Python34libimportlib_bootstrap.py:321: DeprecationWarning: django.utils.si
mplejson is deprecated; use json instead.
return json
Traceback (most recent call last):
File "C:sitemanage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:Python34libsite-packagesdjangocoremanagement__init__.py", line
399, in execute_from_command_line
utility.execute()
File "C:Python34libsite-packagesdjangocoremanagement__init__.py", line
392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:Python34libsite-packagesdjangocoremanagementbase.py", line 242,
in run_from_argv
self.execute(*args, **options.__dict__)
File "C:Python34libsite-packagesdjangocoremanagementbase.py", line 280,
in execute
translation.activate('en-us')
File "C:Python34libsite-packagesdjangoutilstranslation__init__.py", lin
e 130, in activate
return _trans.activate(language)
File "C:Python34libsite-packagesdjangoutilstranslationtrans_real.py", l
ine 188, in activate
_active.value = translation(language)
File "C:Python34libsite-packagesdjangoutilstranslationtrans_real.py", l
ine 177, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "C:Python34libsite-packagesdjangoutilstranslationtrans_real.py", l
ine 159, in _fetch
app = import_module(appname)
File "C:Python34libimportlib__init__.py", line 104, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
File "<frozen importlib._bootstrap>", line 2189, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1448, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "C:Python34libsite-packagesfile_picker__init__.py", line 4, in <modu
le>
from file_picker.views import FilePickerBase, ImagePickerBase
File "C:Python34libsite-packagesfile_pickerviews.py", line 17, in <module>
from sorl.thumbnail.main import DjangoThumbnail
ImportError: No module named 'sorl.thumbnail.main'
您使用的是旧版本的sorl-thumbnail -它不能与您的django版本一起工作。您需要升级sorl-thumbnail。不能说得更具体,因为我不知道你用的是sorl-thumbnail和django的哪个版本
看起来语法错误在"C:Python34libsite-packagesfile_pickerviews.py",第73行
except语句有语法错误