1

I'm trying to get the graph_models of my app. I already did it once, but now I'm getting this error, and I'm not able to find a solution to the problem.

Traceback:

$ 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

What have i tried?

  1. commented the INSTALLED_APPS (one by one: there was already an issue with the 'debug_toolbar' the last time it worked)
  2. python manage.py graph_models --pygraphviz -g -o m.png my_app_01 (my_app_02, 03, and so on)
  3. git checkout ### (to the last time it worked, and also to differents commits)

And nothing happens, and actually, because of 3. i suspect that something beyond my app could be happening. Otherwise, if before has worked, why is not working anymore within the commit that once has worked?

So... any ideas on how to find a solution? Thanks for your time! (and my apologies for a bad-english)

f-spin
  • 162
  • 10
  • Uhm, and what do you mean precissely with *relevant*? I mean, i'm using the `graph_models` from the `django-extensions` third-party app: and as i saw in its (brief) [documentation](http://django-extensions.readthedocs.org/en/latest/graph_models.html) the command should look like `python manage.py graph_models -a -g -o m.png` (i posted it already at the begining of the pasted traceback). Is there another relevant command that i'm not aware of? – f-spin Feb 03 '16 at 08:51
  • Ah I misread the traceback as it being your own command, apologies – Sayse Feb 03 '16 at 08:54
  • Don't worry, no problem! – f-spin Feb 03 '16 at 12:40
  • Did you ever find the solution? I'm having the same problem (except mine never worked at all) and yours seems to be the only Google result that talks about this! Someone on this question https://stackoverflow.com/questions/6776592/django-model-graphic-representation-erd commented graphviz doesn't work on Python3 - could that be why it stopped working for you? – RubberDuckRabbit Aug 24 '17 at 23:21

0 Answers0