Home:ALL Converter>SQLAlchemy import error : import _mysql

SQLAlchemy import error : import _mysql

Ask Time:2014-08-17T09:11:48         Author:user1885868

Json Formatter

I am new at Python and SQLAlchemy and I was trying to play with them a little bit, but whenever I run a test it gives me the following error :

Traceback (most recent call last):
  File "/home/zakaria/workspace-python/Jerreb/essai/tejriba.py", line 11, in <module>
    engine = create_engine("mysql://root:root@localhost/python")
  File "/usr/local/lib/python2.7/dist-packages/SQLAlchemy-0.9.7-py2.7-linux-i686.egg/sqlalchemy/engine/__init__.py", line 346, in create_engine
    return strategy.create(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/SQLAlchemy-0.9.7-py2.7-linux-i686.egg/sqlalchemy/engine/strategies.py", line 74, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
  File "/usr/local/lib/python2.7/dist-packages/SQLAlchemy-0.9.7-py2.7-linux-i686.egg/sqlalchemy/connectors/mysqldb.py", line 64, in dbapi
    return __import__('MySQLdb')
  File "/usr/local/lib/python2.7/dist-packages/MySQL_python-1.2.5-py2.7-linux-i686.egg/MySQLdb/__init__.py", line 19, in <module>
    import _mysql
ImportError: /usr/local/lib/python2.7/dist-packages/MySQL_python-1.2.5-py2.7-linux-i686.egg/_mysql.so: undefined symbol: _Py_ZeroStruct

I am working with PyDev.

This is the project architecture:

Project Architecture

And these are the libs I have imported :

Project Libs

What is the problem and how can I fix it?

Thanks!

Author:user1885868,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/25345462/sqlalchemy-import-error-import-mysql
yy