Django中的Graph_models:TypeError不能在类字节对象

时间:2016-02-03 06:42:07

标签: python django graphviz django-extensions

我正在尝试获取应用的graph_models。我已经做了一次,但现在我收到了这个错误,我无法找到问题的解决方案。

回溯:

$ python manage.py graph_models --pygraphviz -a -g -o m.png
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "c:\Users\myUser\.virtualenvs\my_django_project\lib\site-packages\django\core\management\__init_
_.py", line 351, in execute_from_command_line
    utility.execute()
  File "c:\Users\myUser\.virtualenvs\my_django_project\lib\site-packages\django\core\management\__init_
_.py", line 343, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "c:\Users\myUser\.virtualenvs\my_django_project\lib\site-packages\django\core\management\base.py
", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "c:\Users\myUser\.virtualenvs\my_django_project\lib\site-packages\django\core\management\base.py
", line 445, in execute
    output = self.handle(*args, **options)
  File "c:\Users\myUser\.virtualenvs\my_django_project\lib\site-packages\django_extensions\management\u
tils.py", line 57, in inner
    ret = func(self, *args, **kwargs)
  File "c:\Users\myUser\.virtualenvs\my_django_project\lib\site-packages\django_extensions\management\c
ommands\graph_models.py", line 87, in handle
    self.render_output_pygraphviz(dotdata, **options)
  File "c:\Users\myUser\.virtualenvs\my_django_project\lib\site-packages\django_extensions\management\c
ommands\graph_models.py", line 133, in render_output_pygraphviz
    graph.layout(prog=kwargs['layout'])
  File "c:\Users\myUser\.virtualenvs\my_django_project\lib\site-packages\pygraphviz\agraph.py", line 13
58, in layout
    data = self._run_prog(prog, ' '.join([args, "-T", fmt]))
  File "c:\Users\myUser\.virtualenvs\my_django_project\lib\site-packages\pygraphviz\agraph.py", line 13
38, in _run_prog
    warnings.warn(b"".join(errors), RuntimeWarning)
TypeError: can't use a string pattern on a bytes-like object

我尝试了什么?

  1. 评论了INSTALLED_APPS(一个接一个:已经有问题了 使用'debug_toolbar'上次工作时)
  2. python manage.py graph_models --pygraphviz -g -o m.png my_app_01(my_app_02,03等)
  3. git checkout ###(到最后一次工作,也是 不同的承诺)
  4. 没有任何反应,实际上,由于 3. ,我怀疑我的应用程序之外的东西可能会发生。否则,如果之前有效,为什么在曾经有效的提交中不再工作?

    那么......关于如何找到解决方案的任何想法?谢谢你的时间! (我为一个坏英语道歉)

0 个答案:

没有答案