Installing MySQL-python

前端 未结 8 678
夕颜
夕颜 2020-11-28 19:58

I got the below failure while trying to get MySQL-python installed on my Ubuntu/Linux Box.From the below it seem like the issue is sh: mysql_config: not found C

8条回答
  •  无人及你
    2020-11-28 20:41

    You have 2 options, as described bellow:


    Distribution package like Glaslos suggested:

    # sudo apt-get install python-mysqldb
    

    In this case you can't use virtualenv no-site-packages (default option) but must use:

    # virtualenv --system-site-packages myenv
    

    Use clean virtualenv and build your own python-mysql package.

    First create virtualenv:

    # virtualenv myvirtualenv
    # source myvirtualenv/bin/activate
    

    Then install build dependencies:

    # sudo apt-get build-dep python-mysqldb
    

    Now you can install python-mysql

    # pip install mysql-python
    

    NOTE Ubuntu package is python-mysql*db* , python pypi package is python-mysql (without db)

提交回复
热议问题