2016-05-12 90 views
-3

我有一個錯誤:導入錯誤:無法導入名稱memoize的1.8-1.9

Invalid template library specified. ImportError raised when trying to load 'crispy_forms.templatetags.crispy_forms_field': cannot import name memoize

下調至1.8並沒有幫助像here

有人在Ubuntu 14.04的工作,但在Win10不起作用

  • Python2.7
  • Django1.9
  • django的鉻ISPY-形式== 1.4.0

Traceback (most recent call last): File "C:\Python27\lib\site-packages\django\core\handlers\base.py", line 149, in get_response response = self.process_exception_by_middleware(e, request) File "C:\Python27\lib\site-packages\django\core\handlers\base.py", line 147, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\Internet\DJANG\django19\django19\newsletter\views.py", line 45, in home return render(request, "newsletter/home.html", context) File "C:\Python27\lib\site-packages\django\shortcuts.py", line 67, in render template_name, context, request=request, using=using) File "C:\Python27\lib\site-packages\django\template\loader.py", line 96, in render_to_string template = get_template(template_name, using=using) File "C:\Python27\lib\site-packages\django\template\loader.py", line 26, in get_template engines = _engine_list(using) File "C:\Python27\lib\site-packages\django\template\loader.py", line 143, in _engine_list return engines.all() if using is None else [engines[using]] File "C:\Python27\lib\site-packages\django\template\utils.py", line 110, in all return [self[alias] for alias in self] File "C:\Python27\lib\site-packages\django\template\utils.py", line 101, in __getitem__ engine = engine_cls(params) File "C:\Python27\lib\site-packages\django\template\backends\django.py", line 31, in __init__ options['libraries'] = self.get_templatetag_libraries(libraries) File "C:\Python27\lib\site-packages\django\template\backends\django.py", line 49, in get_templatetag_libraries libraries = get_installed_libraries() File "C:\Python27\lib\site-packages\django\template\backends\django.py", line 131, in get_installed_libraries for name in get_package_libraries(pkg): File "C:\Python27\lib\site-packages\django\template\backends\django.py", line 148, in get_package_libraries "trying to load '%s': %s" % (entry[1], e) InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'crispy_forms.templatetags.crispy_forms_field': cannot import name memoize [12/May/2016 18:26:17] "GET/HTTP/1.1" 500 109450

+1

可能重複的[無法導入名稱memoize](http://stackoverflow.com/questions/37186​​660/cannot-import-name-memoize) – Sayse

+0

你問這2個小時前,爲此已有一個重複。 – Sayse

+0

我改變了另一個問題上的重複目標,因爲在Django 1.9之前編寫了[先前的回答](http://stackoverflow.com/questions/30308267/importerror-cannot-import-name-memoize/30308791#comment61912691_30308791)釋放。 – Alasdair

回答

0

脆皮形式1.4是過時的。

如果你看看crispy forms changelog,你可以看到何時增加了對不同Django版本的兼容性。

對於Django 1.8,您需要安裝酥脆的表格1.5或更高版本。

對於Django 1.9,您需要安裝脆皮形式1.6或更高版本。

+0

升級到1.6並沒有任何反應 – pachvo

+0

確保升級後重新啓動了服務器。如果它仍然不起作用,請用** full **回溯來更新您的問題。 – Alasdair

+0

我已經重新啓動它。我添加了完整的跟蹤 – pachvo

相關問題