错误:无法访问文件“$libdir/plpython2”:没有那个文件或目录

Shu*_*tra 5 python postgresql ubuntu

我正在运行 postgresql 9.4 ("PostgreSQL 9.4.4 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-14), 64-bit" )

当我尝试在 postgres SQL 中创建语言时:

create language plpythonu;
Run Code Online (Sandbox Code Playgroud)

然后它给出以下错误:

错误:无法访问文件“$libdir/plpython2”:没有这样的文件或目录 SQL 状态:58P01

我试试这个命令:

sudo apt-get install postgresql-contrib-9.4 postgresql-plpython-9.4 
Run Code Online (Sandbox Code Playgroud)

也尝试 sudo apt-get install postgresql-plpython-9.4 但没有运气。它的给出结果是:

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
     postgresql-plpython-9.4 : Depends: postgresql-9.4 (= 9.4.5-1.pgdg12.4+1) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)

aptitude search plpython 命令的输出是:

p postgres-xc-plpython - 用于 Post 的 PL/Python 过程语言

p postgres-xc-plpython:i386 - 用于 Post 的 PL/Python 过程语言

v postgresql-plpython -

v postgresql-plpython:i386 -

p postgresql-plpython-8.2 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-8.2:i386 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-8.3 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-8.3:i386 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-8.4 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-8.4:i386 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-9.0 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-9.0:i386 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-9.1 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-9.1:i386 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-9.2 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-9.2:i386 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-9.3 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-9.3:i386 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-9.4 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-9.4:i386 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-9.5 - 用于 Post 的 PL/Python 过程语言

p postgresql-plpython-9.5:i386 - 用于 Post 的 PL/Python 过程语言

v postgresql-plpython3 -

v postgresql-plpython3:i386 -

p postgresql-plpython3-9.1 - 用于 Po 的 PL/Python 3 过程语言

p postgresql-plpython3-9.1:i386 - 用于 Po 的 PL/Python 3 过程语言

p postgresql-plpython3-9.2 - 用于 Po 的 PL/Python 3 过程语言

p postgresql-plpython3-9.2:i386 - 用于 Po 的 PL/Python 3 过程语言

p postgresql-plpython3-9.3 - 用于 Po 的 PL/Python 3 过程语言

p postgresql-plpython3-9.3:i386 - 用于 Po 的 PL/Python 3 过程语言

p postgresql-plpython3-9.4 - 用于 Po 的 PL/Python 3 过程语言

p postgresql-plpython3-9.4:i386 - 用于 Po 的 PL/Python 3 过程语言

p postgresql-plpython3-9.5 - 用于 Po 的 PL/Python 3 过程语言

p postgresql-plpython3-9.5:i386 - 用于 Po 的 PL/Python 3 过程语言