powa-team / powa-web

PoWA user interface
http://powa.readthedocs.io/
73 stars 30 forks source link

Error on CentOS 6 with PGDG RPMs : ImportError: No module named dialects.postgresql #26

Closed Krysztophe closed 6 years ago

Krysztophe commented 7 years ago

On CentOS6.8 powa-web returns an error at launch:

ImportError: No module named dialects.postgresql

It was installed on a CentOS 6.8 from PGDG repos as described in the quickstart (see below).

I cannot reproduce on CentOS 7.3 ; it works.

[christ@pudding ~]$ sudo  yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
...  Installation  : pgdg-centos96-9.6-3.noarch                                                                             1/1 
  Verifying     : pgdg-centos96-9.6-3.noarch                                                                             1/1 

Installé:
  pgdg-centos96.noarch 0:9.6-3                                                                                               

Terminé !

[christ@pudding ~]$ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
...
Installé:
  epel-release.noarch 0:6-8                                                                                                  

[christ@pudding ~]$ sudo  yum install powa_96-web
...
Dépendances résolues

=============================================================================================================================
 Paquet                                           Architecture        Version                      Dépôt               Taille
=============================================================================================================================
Installation:
 powa_96-web                                      x86_64              3.1.0-3.rhel6                pgdg96              573 k
Installation pour dépendance:
 postgresql-libs                                  x86_64              8.4.20-7.el6                 base                202 k
 python-backports                                 x86_64              1.0-5.el6                    base                5.5 k
 python-backports-ssl_match_hostname              noarch              3.4.0.2-5.el6                base                 12 k
 python-psycopg2                                  x86_64              2.0.14-2.el6                 base                100 k
 python-sqlalchemy                                noarch              0.5.5-3.el6_2                base                1.3 M
 python-tornado                                   noarch              2.2.1-7.el6                  epel                433 k
...
Installé:
  powa_96-web.x86_64 0:3.1.0-3.rhel6                                                                                         

Dépendance(s) installée(s) :
  postgresql-libs.x86_64 0:8.4.20-7.el6                                   python-backports.x86_64 0:1.0-5.el6               
  python-backports-ssl_match_hostname.noarch 0:3.4.0.2-5.el6              python-psycopg2.x86_64 0:2.0.14-2.el6             
  python-sqlalchemy.noarch 0:0.5.5-3.el6_2                                python-tornado.noarch 0:2.2.1-7.el6               

Terminé !

[christ@pudding ~]$ powa-web
Traceback (most recent call last):
  File "/usr/bin/powa-web", line 2, in <module>
    from powa import make_app
  File "/usr/lib/python2.6/site-packages/powa/__init__.py", line 17, in <module>
    from powa.overview import Overview
  File "/usr/lib/python2.6/site-packages/powa/overview.py", line 10, in <module>
    from powa.sql.views import (
  File "/usr/lib/python2.6/site-packages/powa/sql/__init__.py", line 7, in <module>
    from sqlalchemy.dialects.postgresql import array, dialect as pgdialect
ImportError: No module named dialects.postgresql

Idem avec sudo

rjuju commented 7 years ago

This is due to unsupported SQLAlchemy version.

The documentation states:

You’ll need the following dependencies: [...] sqlalchemy >= 0.8.0

while Centos 6 provides

python-sqlalchemy noarch 0.5.5-3.el6_2

AFAICS the package doesn't have the version dependancy: https://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob;f=rpm/redhat/9.6/powa/EL-6/powa.spec;h=22be7a5c8af2ac554f5e4347b3a3e667091f8e46;hb=HEAD#l46

I'm not that familiar with centos/RHEL, but unless some repo provide more recent version of SQLAlchemy, powa-web isn't going to be easily installed on Centos 6.

Unless of course we add compatiblity for SQLAlchemy 0.5. Any chance you know if this is doable? Otherwise I'll take a look at it.

daftaupe commented 7 years ago

Hello,

here is a little workaround for RHEL6.4 the sqlalchemy 0.8 can be found in the epel repo http://mirrors.ircam.fr/pub/fedora/epel/6/x86_64/python-sqlalchemy0.8-0.8.2-4.el6.x86_64.rpm On RHEL 6.4 after having been installed it's required to do ln -s /usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy /usr/lib64/python2.6/site-packages/

Otherwise you get the following trace

Traceback (most recent call last):
  File "./powa-web", line 2, in <module>
    from powa import make_app
  File "/root/powa-web-3.1.3/powa/__init__.py", line 15, in <module>
    from powa.framework import AuthHandler
  File "/root/powa-web-3.1.3/powa/framework.py", line 7, in <module>
    from sqlalchemy import create_engine, text
ImportError: No module named sqlalchemy

After that you can start powa-web :)

Hope this helps. Regards,

rjuju commented 7 years ago

Thanks a lot @daftaupe !

I'll add this to the documentation.

rjuju commented 6 years ago

Sorry I completely forgot about this. I just pushed https://github.com/powa-team/powa/commit/b0791e42ff3eed6783585146b5e487bc52702177.

Thanks again!