Skip to content

FileNotFoundError: [WinError 2] The system cannot find the file specified #39

@psg719

Description

@psg719

I'm connecting to a database using odbc using a guest database account and I keep getting file not found error. Any help would be appreciated.

Thanks

from sqlalchemy_schemadisplay import create_schema_graph

connection_string = ('Driver={SQL Server};'
            'Server=MYSERVER;'
            'Database=MYDATABASE;'
            'Trusted_Connection=no;'
            'UID=username;'
            'PWD=password;')


DATABASE_URL = URL.create("mssql+pyodbc", query={"odbc_connect": connection_string})

graph = create_schema_graph(metadata=MetaData(DATABASE_URL),
    show_datatypes=False,
    show_indexes=False,
    rankdir='LR', 
    concentrate=False
)
graph.write_png('dbschema.png')

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
[c:\Users\AppData\Local\Programs\Python\Python37\lib\site-packages\pydot.py](file:///C:/Users/AppData/Local/Programs/Python/Python37/lib/site-packages/pydot.py) in create(self, prog, format, encoding)
   1925                 arguments=arguments,
-> 1926                 working_dir=tmp_dir,
   1927             )

[c:\Users\AppData\Local\Programs\Python\Python37\lib\site-packages\pydot.py](file:///C:/Users/AppData/Local/Programs/Python/Python37/lib/site-packages/pydot.py) in call_graphviz(program, arguments, working_dir, **kwargs)
    138         stdout=subprocess.PIPE,
--> 139         **kwargs
    140     )

[c:\Users\AppData\Local\Programs\Python\Python37\lib\subprocess.py](file:///C:/Users/AppData/Local/Programs/Python/Python37/lib/subprocess.py) in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
    799                                 errread, errwrite,
--> 800                                 restore_signals, start_new_session)
    801         except:

[c:\Users\AppData\Local\Programs\Python\Python37\lib\subprocess.py](file:///C:/Users/AppData/Local/Programs/Python/Python37/lib/subprocess.py) in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
   1206                                          os.fspath(cwd) if cwd is not None else None,
-> 1207                                          startupinfo)
   1208             finally:

FileNotFoundError: [WinError 2] The system cannot find the file specified```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions