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

Hello, the dreaded file not found error strikes again. Wondering if anyone can see what’s wrong here.

Here’s the Trackback
Traceback (most recent call last):
File “C:\Program Files\Python310\lib\runpy.py”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File “C:\Program Files\Python310\lib\runpy.py”, line 86, in run_code
exec(code, run_globals)
File "C:\Users\Owner\AppData\Roaming\Python\Python310\Scripts\nycdb.exe_main
.py", line 7, in
File “C:\Users\Owner\AppData\Roaming\Python\Python310\site-packages\nycdb\cli.py”, line 111, in main
dispatch(args)
File “C:\Users\Owner\AppData\Roaming\Python\Python310\site-packages\nycdb\cli.py”, line 104, in dispatch
Dataset(args.dump, args=args).dump()
File “C:\Users\Owner\AppData\Roaming\Python\Python310\site-packages\nycdb\dataset.py”, line 167, in dump
subprocess.run(cmd, env=self.pg_env(), check=True)
File “C:\Program Files\Python310\lib\subprocess.py”, line 501, in run
with Popen(*popenargs, **kwargs) as process:
File “C:\Program Files\Python310\lib\subprocess.py”, line 969, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File “C:\Program Files\Python310\lib\subprocess.py”, line 1438, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

The documentation of nycdb says that Postgres is required. Here are the PostgreSQL installers for Windows. Per the source code of the dump() function, it’s trying to run a “pg_dump” command. Make sure the directory that contains this executable is added to the PATH environment variable. I don’t use PostgreSQL, so I can’t tell you the location of “pg_dump”. It’s probably in a “bin” subdirectory of the installation directory.