Django模型图(pydot)错误 [英] Django Model Graph (pydot) Error

查看:298
本文介绍了Django模型图(pydot)错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我开始使用现有的复杂模型开发一个大型的Django项目。我需要可视化该模型,所以我决定使用django-extensions(即 pygraphviz )。但是不幸的是,在Windows上使用pip无法安装 pygraphviz ,所以我安装了 pydot



运行以下命令命令在Windows cmd:

  python manage.py graph_models --pydot -a -g -o my_project_visualized.png 

我收到以下错误:

 code> AttributeError:'list'对象没有属性'write'

任何建议如何解决这个问题?

解决方案

pydot == 1.1.0不适用于Python 3.5。因为pydot 1.1.0与 Python 3.5 不兼容



使用 pydotplus 为我工作。

  pip install pydotplus 


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?

解决方案

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

这篇关于Django模型图(pydot)错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆