ERAlchemy无法连接到数据库

时间:2019-01-28 03:10:08

标签: python-2.7 sqlite

我不理解调用ERAlchemy的呈现功能的语法(https://pypi.org/project/ERAlchemy请参见“ Python的用法”)。我正在使用Python 2.7,sqlite3和PyCharm。我已经安装了ERAlchemy,GraphViz和PyGraphViz。

我正在尝试以下操作,但是它无法连接到数据库:

from eralchemy import render_er
render_er("sqlite:///C:\\Users\\myname\\Documents\\Work\\pythonsqlite.db", 'erd_from_sqlite.png')

这是错误:

Traceback (most recent call last):
  File "C:/Users/myname/Documents/Work/_sql_functions_rev0.py", line 81, in <module>
    render_er("sqlite:///C:\\Users\\myname\\Documents\\Work\\pythonsqlite.db", 'erd_from_sqlite.png')
  File "C:\Python27\ArcGISx6410.6\lib\site-packages\eralchemy\main.py", line 236, in render_er
    intermediary_to_output(tables, relationships, output)
  File "C:\Python27\ArcGISx6410.6\lib\site-packages\eralchemy\main.py", line 75, in intermediary_to_schema
    graph.draw(path=output, prog='dot', format=extension)
  File "C:\Python27\ArcGISx6410.6\lib\site-packages\pygraphviz\agraph.py", line 1474, in draw
    data = self._run_prog(prog, args)
  File "C:\Python27\ArcGISx6410.6\lib\site-packages\pygraphviz\agraph.py", line 1308, in _run_prog
    runprog = r'"%s"' % self._get_prog(prog)
  File "C:\Python27\ArcGISx6410.6\lib\site-packages\pygraphviz\agraph.py", line 1295, in _get_prog
    raise ValueError("Program %s not found in path." % prog)
ValueError: Program dot not found in path.

1 个答案:

答案 0 :(得分:0)

啊!找到了答案https://leetcode.com/problems/partition-equal-subset-sum/

必须找到带有“ dot.exe”的文件夹,并将其添加到环境变量->系统变量->路径