How to install MySQLdb package? (ImportError: No module named setuptools)

后端 未结 11 1153
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-25 10:20

I am trying to install MySQLdb package. I found the source code here.

I did the following:

gunzip MySQL-python-1.2.3c1.tar.gz
tar xvf MySQL-python-1.         


        
11条回答
  •  盖世英雄少女心
    2020-12-25 11:17

    This was sort of tricky for me too, I did the following which worked pretty well.

    • Download the appropriate Python .egg for setuptools (ie, for Python 2.6, you can get it here. Grab the correct one from the PyPI site here.)
    • chmod the egg to be executable: chmod a+x [egg] (ie, for Python 2.6, chmod a+x setuptools-0.6c9-py2.6.egg)
    • Run ./[egg] (ie, for Python 2.6, ./setuptools-0.6c9-py2.6.egg)

    Not sure if you'll need to use sudo if you're just installing it for you current user. You'd definitely need it to install it for all users.

提交回复
热议问题