在CentOS 7.2上为PostgreSQL 9.5安装plpython3u

时间:2016-07-17 01:22:43

标签: python postgresql centos postgresql-9.5 plpython

尽我所能,我没有成功在PostgreSQL 9.5 x64安装上安装plpython3u扩展。

从pgdg repo安装PostgreSQL 9.5:

https://www.dropbox.com/s/jhbxsncd97rq1z4/gtfs_OD_links_L.csv?dl=0

安装python 3.5:

[joe@postgresql ~]$ yum list installed | grep pgdg
CGAL.x86_64                          4.7-1.rhel7                 @pgdg95
SFCGAL.x86_64                        1.2.2-1.rhel7               @pgdg95
SFCGAL-libs.x86_64                   1.2.2-1.rhel7               @pgdg95
geos.x86_64                          3.5.0-1.rhel7               @pgdg95
pgdg-centos95.noarch                 9.5-2                       installed
plv8_95.x86_64                       1.4.4-1.rhel7               @pgdg95
postgis2_95.x86_64                   2.2.2-1.rhel7               @pgdg95
postgis2_95-client.x86_64            2.2.2-1.rhel7               @pgdg95
postgresql95.x86_64                  9.5.3-2PGDG.rhel7           @pgdg95
postgresql95-contrib.x86_64          9.5.3-2PGDG.rhel7           @pgdg95
postgresql95-devel.x86_64            9.5.3-2PGDG.rhel7           @pgdg95
postgresql95-libs.x86_64             9.5.3-2PGDG.rhel7           @pgdg95
postgresql95-plpython.x86_64         9.5.3-2PGDG.rhel7           @pgdg95
postgresql95-server.x86_64           9.5.3-2PGDG.rhel7           @pgdg95

当我尝试在数据库中启用plpython3u时:

[joe@postgresql ~]$ yum list installed | grep python35
python35u.x86_64                     3.5.2-1.ius.centos7            @ius
python35u-devel.x86_64               3.5.2-1.ius.centos7            @ius
python35u-libs.x86_64                3.5.2-1.ius.centos7            @ius
python35u-pip.noarch                 8.1.2-1.ius.centos7            @ius
python35u-setuptools.noarch          22.0.5-1.ius.centos7           @ius

这与它有关吗?

psql (9.5.3)
Type "help" for help.

postgres=# create extension plpython3u;
ERROR:  could not open extension control file "/usr/pgsql-9.5/share/extension/plpython3u.control": No such file or directory
postgres=# \q

感谢你的帮助......把头发拉出来。

修改

当然,由于某种原因,似乎没有安装......!

[joe@postgresql ~]$ which python
/usr/bin/python
[joe@postgresql ~]$ ls /usr/bin/pyt* -l
lrwxrwxrwx. 1 root root     7 Jul 15 23:05 /usr/bin/python -> python2
lrwxrwxrwx. 1 root root     9 Jul 15 23:05 /usr/bin/python2 -> python2.7
-rwxr-xr-x. 1 root root  7136 Nov 19  2015 /usr/bin/python2.7
-rwxr-xr-x. 2 root root 11304 Jun 27 12:05 /usr/bin/python3.5
lrwxrwxrwx. 1 root root    26 Jul 16 18:14 /usr/bin/python3.5-config -> /usr/bin/python3.5m-config
-rwxr-xr-x. 2 root root 11304 Jun 27 12:05 /usr/bin/python3.5m
-rwxr-xr-x. 1 root root   173 Jun 27 12:04 /usr/bin/python3.5m-config
-rwxr-xr-x. 1 root root  3398 Jun 27 12:02 /usr/bin/python3.5m-x86_64-config

还有:

[joe@postgresql ~]$  ls -l /usr/pgsql-9.5/lib/plp*
-rwxr-xr-x. 1 root root 174352 May 14 15:49 /usr/pgsql-9.5/lib/plpgsql.so
-rwxr-xr-x. 1 root root 123632 May 14 15:49 /usr/pgsql-9.5/lib/plpython2.so

1 个答案:

答案 0 :(得分:0)

尝试使用yum

yum install postgresql95-contrib postgresql95-plpython3