当前位置: 动力学知识库 > 问答 > 编程问答 >

python - Django Model Graph (pydot) Error

问题描述:

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
分享给朋友:
您可能感兴趣的文章:
随机阅读: