Python MySQL wrong architecture error

后端 未结 12 2209

I\'ve been at this for some time and read many sites on the subject. suspect I have junk lying about causing this problem. But where?

This is the error when I impor

12条回答
  •  萌比男神i
    2020-12-08 05:10

    It's caused by that your Python is 32bits, but somehow, the installed MySQL library is 64bits. To solve the problem, here you can install it manually with following commands:

    wget http://downloads.sourceforge.net/project/mysql-python/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz
    tar xvf MySQL-python-1.2.3.tar.gz
    cd MySQL-python-1.2.3
    ARCHFLAGS="-arch i386" python setup.py install
    

    With ARCHFLAGS="-arch i386", it should be compiled as i386 architecture.

提交回复
热议问题