I have recently started working on a big Django project with existing complicated model. I needed to visualize that model, so I decided to use django-extensions (namely pygraphviz). But unfortunately, failed to install pygraphviz on windows using pip, so I installed pydot.
When Running the following command on windows cmd:
python manage.py graph_models --pydot -a -g -o my_project_visualized.png
I get the following Error:
AttributeError: 'list' object has no attribute 'write'
Any Suggestion of how to solve this issue?
You must use older pydot
. Version 1.1.0 works for me. Install with:
pip install pydot==1.1.0
pydot==1.1.0 doesn't work for me with Python 3.5. as pydot 1.1.0 is not compatible with Python 3.5
Using pydotplus worked for me.
pip install pydotplus
来源:https://stackoverflow.com/questions/38403350/django-model-graph-pydot-error