[Imdbpy-help] Problems using imdbpy2sql.py

52 views
Skip to first unread message

Francis Augusto Medeiros

unread,
Mar 1, 2017, 2:38:35 PM3/1/17
to imdbp...@lists.sourceforge.net
Hi,

I am trying to use the script, but I get the following error:

Traceback (most recent call last):

  File "imdbpy2sql.py", line 325, in <module>

    from imdb.parser.sql.objectadapter import getDBTables, setConnection

  File "/Library/Python/2.7/site-packages/IMDbPY-5.1-py2.7-macosx-10.12-intel.egg/imdb/parser/sql/objectadapter.py", line 26, in <module>

    from sqlobject import *

  File "/Library/Python/2.7/site-packages/SQLObject-3.2.0b1.dev20170223-py2.7.egg/sqlobject/__init__.py", line 8, in <module>

    from .col import *  # noqa

  File "/Library/Python/2.7/site-packages/SQLObject-3.2.0b1.dev20170223-py2.7.egg/sqlobject/col.py", line 33, in <module>

    from formencode import compound, validators

  File "/Library/Python/2.7/site-packages/FormEncode-2.0.0a1-py2.7.egg/formencode/__init__.py", line 4, in <module>

    from formencode.api import (

  File "/Library/Python/2.7/site-packages/FormEncode-2.0.0a1-py2.7.egg/formencode/api.py", line 6, in <module>

    from . import declarative

  File "/Library/Python/2.7/site-packages/FormEncode-2.0.0a1-py2.7.egg/formencode/declarative.py", line 104, in <module>

    class Declarative(six.with_metaclass(DeclarativeMeta, object)):

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six.py", line 566, in with_metaclass

    return meta("NewBase", bases, {})

  File "/Library/Python/2.7/site-packages/FormEncode-2.0.0a1-py2.7.egg/formencode/declarative.py", line 71, in __new__

    for name in cls.__mutableattributes__:

AttributeError: type object 'NewBase' has no attribute '__mutableattributes__'



When I try to run with sqlalchemy, I get the following error:

Traceback (most recent call last):

  File "imdbpy2sql.py", line 538, in <module>

    conn = setConnection(URI, DB_TABLES)

  File "/Library/Python/2.7/site-packages/IMDbPY-5.1-py2.7-macosx-10.12-intel.egg/imdb/parser/sql/alchemyadapter.py", line 489, in setConnection

    engine = create_engine(uri, **params)

  File "/Library/Python/2.7/site-packages/sqlalchemy/engine/__init__.py", line 387, in create_engine

    return strategy.create(*args, **kwargs)

  File "/Library/Python/2.7/site-packages/sqlalchemy/engine/strategies.py", line 160, in create

    engineclass.__name__))

TypeError: Invalid argument(s) 'local_infile' sent to create_engine(), using configuration MySQLDialect_mysqldb/QueuePool/Engine.  Please check that the keyword arguments are appropriate for this combination of components.


Could you help me?

Yours,

Francis
--
Francis Augusto Medeiros
Oslo, Norway

Roberto Larcher

unread,
Mar 20, 2017, 11:59:42 AM3/20/17
to imdbpy-users, imdbp...@lists.sourceforge.net, regi...@francisaugusto.com

Hi,
I'm facing the same problem. 

To solve the issue I commented the line
params['local_infile'] = 1

inside the fucntion
setConnection

of the alchemyadapter.py file.

In my system the file is located in the following directory:
/usr/lib/python2.7/dist-packages/imdb/parser/sql/alchemyadapter.py

I don't know if this will influence other processes but after this modification the imdbpy2sql.py script is correctly running

Note that my mysql server is configured in order to allow local infile command.

Roberto

Davide Alberani

unread,
Mar 23, 2017, 6:41:33 AM3/23/17
to imdbpy...@googlegroups.com, imdbp...@lists.sourceforge.net, regi...@francisaugusto.com, Roberto Larcher
On Mon, Mar 20, 2017 at 4:59 PM, Roberto Larcher <lar...@gmail.com> wrote:
>
> I don't know if this will influence other processes but after this
> modification the imdbpy2sql.py script is correctly running

Thanks for the help!
Maybe now the parameter should be added to the URL?

Like https://stackoverflow.com/questions/29903790/load-data-local-infile-sqlalchemy-and-python-to-mysql-db


--
Davide Alberani <davide....@gmail.com> [PGP KeyID: 0x3845A3D4AC9B61AD]
http://www.mimante.net/
Reply all
Reply to author
Forward
0 new messages