Python 错误:使用 python_access 包时缺少“mdb-schema”

Bac*_*ich 3 python ms-access mdbtools

运行于 Ubuntu 16.04、Python 3.6.2

我之前已经成功使用过这个包。事实上,它可以在另一台电脑上运行,但不是我需要它运行的电脑。 https://pypi.python.org/pypi/pandas_access

import pandas_access as mdb
df = mdb.read_table("myDatabase", "myTable")
Run Code Online (Sandbox Code Playgroud)

回溯(最近一次调用最后一次):

文件“”,第 1 行,位于

文件“/home/nfw/anaconda3/lib/python3.6/site-packages/pandas_access/ init .py”,第 118 行,在 read_table schemas = to_pandas_schema(read_schema(rdb_file, schema_encoding),

文件“/home/nfw/anaconda3/lib/python3.6/site-packages/pandas_access/ init .py”,第 59 行,在 read_schema 输出 = subprocess.check_output(['mdb-schema', rdb_file])

文件“/home/nfw/anaconda3/lib/python3.6/subprocess.py”,第 336 行,在 check_output **kwargs).stdout

文件“/home/nfw/anaconda3/lib/python3.6/subprocess.py”,第 403 行,以 Popen(*popenargs, **kwargs) 作为进程运行:

文件“/home/nfw/anaconda3/lib/python3.6/subprocess.py”,第 707 行,在init Restore_signals、start_new_session 中)

文件“/home/nfw/anaconda3/lib/python3.6/subprocess.py”,第 1333 行,在 _execute_child 中引发 child_exception_type(errno_num, err_msg)

FileNotFoundError:[Errno 2]没有这样的文件或目录:'mdb-schema'

pandas_access 的代码可以在这里找到

https://github.com/jbn/pandas_access/blob/master/pandas_access/ init .py

它应该只需要我已经安装的 MDB 工具并且它可以工作。我可以使用MDB Tools 自己打开access 数据库。

Bac*_*ich 5

解决了!

我在工作电脑的命令行上运行 mdb-schema 并得到:

用法: mdb-schema [选项] [] 其中选项为: -T 仅为命名表创建模式 -N 带命名空间的前缀标识符

我在非工作电脑上咆哮 mdb-schema 并得到:程序“mdb-schema”当前未安装。您可以通过键入以下命令来安装它: sudo apt install mdbtools

不知道我是如何没有安装这个的,因为我之前肯定在它上面运行过 gmdb2,但是哦,好吧,需要继续。