D
D
Dominik092017-04-17 00:17:16
Django
Dominik09, 2017-04-17 00:17:16

How to fix error while creating database schema via graphviz in django?

You need to create a database schema for your django project. I did everything according to the documentation: installed django_extensions, graphviz and pydot, everything is as it says here django-extensions.readthedocs.io/en/latest/graph_m...
The dot file creates without problems, but when I try to create a png file, the following error pops up:

Traceback (most recent call last):
  File "/home/user/Django/lib/python3.4/site-packages/pydot.py", line 1878, in create
    stderr=subprocess.PIPE, stdout=subprocess.PIPE)
  File "/usr/lib/python3.4/subprocess.py", line 848, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.4/subprocess.py", line 1446, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'dot'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/user/Django/lib/python3.4/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
    utility.execute()
  File "/home/user/Django/lib/python3.4/site-packages/django/core/management/__init__.py", line 342, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/user/Django/lib/python3.4/site-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/user/Django/lib/python3.4/site-packages/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "/home/user/Django/lib/python3.4/site-packages/django_extensions/management/utils.py", line 58, in inner
    ret = func(self, *args, **kwargs)
  File "/home/user/Django/lib/python3.4/site-packages/django_extensions/management/commands/graph_models.py", line 168, in handle
    self.render_output_pydot(dotdata, **options)
  File "/home/user/Django/lib/python3.4/site-packages/django_extensions/management/commands/graph_models.py", line 230, in render_output_pydot
    graph.write(output_file, format=format)
  File "/home/user/Django/lib/python3.4/site-packages/pydot.py", line 1774, in write
    s = self.create(prog, format)
  File "/home/user/Django/lib/python3.4/site-packages/pydot.py", line 1883, in create
    prog=prog))
Exception: "dot" not found in path.

As I understand it, the problem is that it cannot find the dot file, but I could not find a solution to the problem. Can anyone suggest how to fix this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question